Thread View: net.sources.bugs
1 messages
1 total messages
Started by roger
Fri, 27 Feb 1987 22:32
One more SHAR, one more time ...
Author: roger
Date: Fri, 27 Feb 1987 22:32
Date: Fri, 27 Feb 1987 22:32
83 lines
3358 bytes
3358 bytes
[feed a line eater today]
So sad, my wonderous SHAR wasn't so case hardened as I imagined.
There is a very nasty bug that occurs when it tries to incorporate
a file which it doesn't have read access to. The SHAR produced
script would hang when it attempted to unbundle. So ... below is
a diff which should correct the problem. It should be patchable
to the original "shar.c" file sent out. The new output will not
hang, and prints a message when unbundling that a read error had
occured at SHAR time.
Rogue Monster
-------- cut -------- cut -------- cut -------- cut -------- cut --------
*** shar.c Fri Feb 27 14:04:19 1987
--- org/shar.c Fri Feb 27 13:52:31 1987
***************
*** 413,433 ****
*/
CheckTree(stm,ref->Leaf->Parent);
/*
! * Put out the existance check header if required.
*/
MakePathName(ref->Leaf);
if (!OverWrite)
fprintf(stm,"if `test ! -s %s`\nthen\n",PathName);
/*
! * Open the input file. Echo file name written.
*/
if (!(inp = fopen(PathName,"r"))){
fprintf(stderr,"Unable to read \"%s\"\n",PathName);
- fprintf(stm," echo \"read error when SHAR-ed: %s\"\nfi\n",PathName);
return;
}
- if (!Quiet)
- fprintf(stm,"echo \"writting %s\"\n",PathName);
fprintf(stm,"cat > %s << '%s'\n",PathName,Terminal);
/*
* Move the file data into the archive.
--- 413,433 ----
*/
CheckTree(stm,ref->Leaf->Parent);
/*
! * Put out the existance check header if required. Also do the
! * file name echoing.
*/
MakePathName(ref->Leaf);
if (!OverWrite)
fprintf(stm,"if `test ! -s %s`\nthen\n",PathName);
+ if (!Quiet)
+ fprintf(stm,"echo \"writting %s\"\n",PathName);
/*
! * Open the input file.
*/
if (!(inp = fopen(PathName,"r"))){
fprintf(stderr,"Unable to read \"%s\"\n",PathName);
return;
}
fprintf(stm,"cat > %s << '%s'\n",PathName,Terminal);
/*
* Move the file data into the archive.
***************
*** 478,484 ****
/*
* Open the output file, failure here causes a return.
*/
! sprintf(CharBuf,"%s.shr%d",RootName,fil->Number);
if (!(stm = fopen(CharBuf,"w"))){
fprintf(stderr,"Unable to open archive: %s\n",CharBuf);
return;
--- 478,484 ----
/*
* Open the output file, failure here causes a return.
*/
! sprintf(CharBuf,"%s.%d",RootName,fil->Number);
if (!(stm = fopen(CharBuf,"w"))){
fprintf(stderr,"Unable to open archive: %s\n",CharBuf);
return;
-------- cut -------- cut -------- cut -------- cut -------- cut --------
--
-Rogue Monster (also known as Roger March)
UUCP: {decvax,ucbvax,ihnp4,hplabs}!decwrl!mips!roger
USPS: MIPS Computer Systems, 930 Arques, Sunnyvale, CA 94086, (408) 991-0220
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads