🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sources.bugs
Article #104

Minor bug (plus fix) for brik

#104
From: Fred Fish
Date: Thu, 27 Jul 1989 02:03
34 lines
1520 bytes
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
Technical Details
Message-ID: <209@estinc.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!cs.utexas.edu!usc!apple!ames!ncar!asuvax!mcdphx!estinc!fnf

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!cs.utexas.edu!usc!apple!ames!ncar!asuvax!mcdphx!estinc!fnf
From: fnf@estinc.UUCP (Fred Fish)
Newsgroups: comp.sources.bugs
Subject: Minor bug (plus fix) for brik
Message-ID: <209@estinc.UUCP>
Date: 27 Jul 89 02:03:12 GMT
Organization: Enhanced Software Technologies Inc., Tempe, Az
Lines: 34