Minor bug (plus fix) for brik
Fred Fish
fnf at estinc.UUCP
Thu Jul 27 12:03:12 AEST 1989
The recently posted brik program in comp.sources.misc has a minor bug,
it doesn't properly handle filenames with embedded whitespace. Other than
that, it appears to be a really useful utility. I had no problem porting
it to the Amiga in about an hour. Here is my (unofficial of course) fix
for the whitespace bug:
*** brik.c.old Wed Jul 26 15:13:00 1989
--- brik.c Wed Jul 26 19:01:29 1989
***************
*** 518,524
goto badline;
}
fname = p;
! while (*p != '\0' && !whitespace(*p)) /* skip to whitespace */
p++;
*p = '\0'; /* null-terminate filename */
--- 518,528 -----
goto badline;
}
fname = p;
! /* Names CAN contain whitespace, and even newlines, however there
! * is no provision to store names with embedded newlines, so we
! * are out of luck for that case...
! */
! while (*p != '\0' && *p != '\n')
p++;
*p = '\0'; /* null-terminate filename */
--
# Fred Fish, 1835 E. Belmont Drive, Tempe, AZ 85284, USA
# 1-602-491-0048 asuvax!{nud,mcdphx}!estinc!fnf
More information about the Comp.sources.bugs
mailing list