From: Cojocaru Alexandru <xojoc@gmx.com>
To: linux-assembly@vger.kernel.org
Subject: [PATCH] asmutils-0.18 (basename.asm): bugfixes
Date: Sun, 9 Dec 2012 13:46:54 +0100 [thread overview]
Message-ID: <20121209134654.4c61df709319a9c2b2d229a7@gmx.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 145 bytes --]
Bugfixes for asmutils-0.18 (basename.asm):
$ basename '' # causes segfault.
$ basename '/' # causes segfault.
Best regards,
Cojocaru Alexandru
[-- Attachment #2: basename-bugfixes.patch --]
[-- Type: application/octet-stream, Size: 1104 bytes --]
17a18
> ;0.05; 09-Dec-2012 bugfixes
26,27c27,28
< pop eax
< mov edi,eax ;edi holds argument count
---
> pop ecx
> mov edi,ecx ;edi holds argument count
33,35c34,36
< pop eax ;skip our name
< pop eax ;the path
< mov ebx,eax ;mark the beginning of path
---
> pop ecx ;skip our name
> pop ecx ;the path
> mov ebx,ecx ;mark the beginning of path
37c38
< cmp byte [eax],EOL
---
> cmp byte [ecx],EOL
40,41c41,42
< inc eax
< cmp byte [eax],EOL
---
> inc ecx
> cmp byte [ecx],EOL
43c44
< mov edx,eax ;mark the end
---
> mov edx,ecx ;mark the end
45,47c46,48
< dec eax
< cmp eax,ebx
< jnl .empty
---
> dec ecx
> cmp ecx,ebx
> jg .empty
51c52
< cmp byte [eax],'/'
---
> cmp byte [ecx],'/'
53,54c54,55
< inc eax
< mov edx,eax
---
> mov edx,ecx
> inc edx
56,59c57,60
< dec eax
< cmp byte [eax],'/'
< je .endlooptwoinceax
< cmp eax,ebx
---
> dec ecx
> cmp byte [ecx],'/'
> je .endlooptwoincecx
> cmp ecx,ebx
79,80c80,81
< .endlooptwoinceax:
< inc eax
---
> .endlooptwoincecx:
> inc ecx
83,84c84
< mov ecx,eax
< sub edx,eax
---
> sub edx,ecx
91c91
<
---
>
reply other threads:[~2012-12-09 12:46 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20121209134654.4c61df709319a9c2b2d229a7@gmx.com \
--to=xojoc@gmx.com \
--cc=linux-assembly@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).