Thread View: comp.bugs.sys5
1 messages
1 total messages
Started by Guy Harris
Wed, 05 Jul 1989 19:53
"sed" gets confused by empty "-f" files
Author: Guy Harris
Date: Wed, 05 Jul 1989 19:53
Date: Wed, 05 Jul 1989 19:53
50 lines
1535 bytes
1535 bytes
If you hand "sed" an empty file with the "-f" flag, the S5 "sed" gets
confused and acts as if no "-f" flag were given, and tries to parse the
argument after the filename as a "sed" script. As somebody who noted
this bug elsewhere said:
This bug affects, e.g., shell programs that build up temporary sed
scripts, which may possibly be null, for use as filters.
The fix appears to have been in V7, so I guess S5 never got around to
picking it up. The fix is:
*** sed.h.orig Thu Jun 29 11:38:43 1989
--- sed.h Thu Jun 29 11:39:01 1989
***************
*** 129,131 ****
--- 129,132 ----
struct label *search();
char *gline();
char *place();
+ char compfl;
*** sed0.c.orig Thu Jun 29 11:37:25 1989
--- sed0.c Thu Jun 29 11:38:23 1989
***************
*** 119,125 ****
}
! if(rep == ptrspace) {
eargv--;
eargc++;
eflag++;
--- 119,125 ----
}
! if(compfl == 0) {
eargv--;
eargc++;
eflag++;
***************
*** 155,160 ****
--- 155,161 ----
int i, ii;
struct label *lpt;
+ compfl = 1;
op = lastre;
if(rline(linebuf) < 0) return;
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