Explicitly use "." instead of the result of basename(3) when argv[0] is
an empty string in order to avoid a segfault.
Skip suffix treatment if the result of basename(3) is "/", per POSIX.
Fix the suffix check, which was previously checking for a match at any
location in the string.
---
basename
Whoops, I wrote argv[0] instead of s a couple of times.
Ignore this patch. I'll submit another momentarily.
On Wed, Dec 03, 2014 at 05:37:16PM -0500, Brandon Mulcahy wrote:
> Skipped suffix treatment if the result of basename(3) is "/", per POSIX.
>
> Fixed the suffix check, which was previously
Skipped suffix treatment if the result of basename(3) is "/", per POSIX.
Fixed the suffix check, which was previously checking for a match
at any location in the string. Also, strstr used to segfault on:
basename '' .
---
basename.c | 12
1 file changed, 8 insertions(+), 4
If several lines are given to the stdin of sic in a single write() call
(by whatever is controlling sic), only the first line will be seen by
sic until the stdin file descriptor is triggered the next time. This is
due to interactions between C stdio buffering and the use of select().
sic already d