Allow files.i386, files and devices.i386 to have commnets
in the form of a leading #.
This in turn allows these files to be patched correctly by the patchkit.
AUTHOR: Julian Elischer (julian@ref.tfs.com)
386BSD-Patchkit: patch00096
*
* PATCHES MAGIC LEVEL PATCH THAT GOT US HERE
* -------------------- ----- ----------------------
*
* PATCHES MAGIC LEVEL PATCH THAT GOT US HERE
* -------------------- ----- ----------------------
- * CURRENT PATCH LEVEL: 1 00001
+ * CURRENT PATCH LEVEL: 2 00096
* -------------------- ----- ----------------------
*
* 29 Jun 92 Chris G. Demetriou Fix Version number update
* -------------------- ----- ----------------------
*
* 29 Jun 92 Chris G. Demetriou Fix Version number update
+ * 15 Feb 93 Julian Elischer allow comments (leading #) in
+ * files and files.i386
}
if (wd == 0)
goto next;
}
if (wd == 0)
goto next;
+ /*************************************************\
+ * If it's a comment ignore to the end of the line *
+ \*************************************************/
+ if(wd[0] == '#')
+ {
+ while( ((wd = get_word(fp)) != (char *)EOF) && wd)
+ ;
+ goto next;
+ }
this = ns(wd);
next_word(fp, wd);
if (wd == 0) {
this = ns(wd);
next_word(fp, wd);
if (wd == 0) {
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
+ *
+ * PATCHES MAGIC LEVEL PATCH THAT GOT US HERE
+ * -------------------- ----- ----------------------
+ * CURRENT PATCH LEVEL: 1 00096
+ * -------------------- ----- ----------------------
+ *
+ * 15 Feb 93 Julian Elischer Allow comments (leading #) in device file
char buf[BUFSIZ];
int maj;
register struct devdescription **dp = &devtable;
char buf[BUFSIZ];
int maj;
register struct devdescription **dp = &devtable;
fprintf(stderr, "config: can't open %s\n", buf);
exit(1);
}
fprintf(stderr, "config: can't open %s\n", buf);
exit(1);
}
- while (fscanf(fp, "%s\t%d\n", buf, &maj) == 2) {
- *dp = (struct devdescription *)malloc(sizeof (**dp));
- (*dp)->dev_name = ns(buf);
- (*dp)->dev_major = maj;
- dp = &(*dp)->dev_next;
+ while(fgets(linebuf,256,fp))
+ {
+ /*******************************\
+ * Allow a comment *
+ \*******************************/
+ if(linebuf[0] == '#') continue;
+
+ if (sscanf(linebuf, "%s\t%d\n", buf, &maj) == 2)
+ {
+ *dp = (struct devdescription *)malloc(sizeof (**dp));
+ (*dp)->dev_name = ns(buf);
+ (*dp)->dev_major = maj;
+ dp = &(*dp)->dev_next;
+ }
+ else
+ {
+ fprintf(stderr,"illegal line in devices file\n");
+ break;
+ }