Article View: net.bugs
Article #63bug fix to soelim
From: utzoodecvaxharponpoivalicemhtsaa...
Date: Thu, 11 Nov 1982 12:17
Date: Thu, 11 Nov 1982 12:17
102 lines
2449 bytes
2449 bytes
There is a bug in soelim in that it doesn't notice whether the .so is at the
beginning of the line. This means that you can't soelim a file that talks
about net.sources, for example. A fix follows. If you find a bug in this
fix, please let me or the net know about it.
*** /usr/src/cmd/soelim.c.old Wed Oct 1 20:59:43 1980
--- /usr/src/cmd/soelim.c Wed Nov 10 18:30:59 1982
***************
*** 15,20
*
* This program is more generally useful, it turns out, because
* the program tbl doesn't understand ".so" directives.
*/
main(argc, argv)
--- 15,23 -----
*
* This program is more generally useful, it turns out, because
* the program tbl doesn't understand ".so" directives.
+ *
+ * Beginning of line flag added
+ * by Karl Puder, November 10, 1982
*/
main(argc, argv)
***************
*** 43,48
register int c;
char fname[BUFSIZ];
FILE *soee;
soee = fopen(file, "r");
if (soee == NULL) {
--- 46,52 -----
register int c;
char fname[BUFSIZ];
FILE *soee;
+ int begOfLine; /* beginning of line flag */
soee = fopen(file, "r");
if (soee == NULL) {
***************
*** 49,54
perror(file);
return;
}
for (;;) {
c = getc(soee);
if (c < 0)
--- 53,59 -----
perror(file);
return;
}
+ begOfLine = 1;
for (;;) {
c = getc(soee);
if (c < 0)
***************
*** 53,58
c = getc(soee);
if (c < 0)
break;
if (c != '.')
goto simple;
c = getc(soee);
--- 58,67 -----
c = getc(soee);
if (c < 0)
break;
+ if (! begOfLine) /* note that the begOfLine flag is
+ * left on during the grabbing of the
+ * .so command and file name * kop */
+ goto simple;
if (c != '.')
goto simple;
c = getc(soee);
***************
*** 96,101
if (c == EOF)
break;
putchar(c);
}
fclose(soee);
}
--- 105,114 -----
if (c == EOF)
break;
putchar(c);
+ if (c == '\n')
+ begOfLine = 1;
+ else
+ begOfLine = 0;
}
fclose(soee);
}
Technical Details
Message-ID:
<bnews.burdvax.331>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
From: utzoo!decvax!harpo!npoiv!alice!mhtsa!allegra!psuvax!burdvax!puder Newsgroups: net.bugs Title: bug fix to soelim Article-I.D.: burdvax.331 Posted: Thu Nov 11 12:17:48 1982 Received: Fri Nov 12 11:05:52 1982 Subject: bug fix to soelim Date: Thu, 11 Nov 1982 12:17:48 +0000 Message-ID: <bnews.burdvax.331>