PATCH TO CONFIG TO ALLOW COMMENTS IN *.i386
authorJulian Elischer <julian@dialix.oz.au>
Mon, 15 Feb 1993 00:00:00 +0000 (00:00 +0000)
committerJulian Elischer <julian@dialix.oz.au>
Mon, 15 Feb 1993 00:00:00 +0000 (00:00 +0000)
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

usr/src/usr.sbin/config/mkmakefile.c
usr/src/usr.sbin/config/mkswapconf.c

index adf3fc7..8eb7917 100644 (file)
  *
  * 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
  */
 
 #ifndef lint
  */
 
 #ifndef lint
@@ -267,6 +269,15 @@ next:
        }
        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) {
index cb2bb1f..c0307a5 100644 (file)
  * 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
  */
 
 #ifndef lint
  */
 
 #ifndef lint
@@ -192,6 +199,7 @@ devtoname(dev)
 
 initdevtable()
 {
 
 initdevtable()
 {
+       char linebuf[256];
        char buf[BUFSIZ];
        int maj;
        register struct devdescription **dp = &devtable;
        char buf[BUFSIZ];
        int maj;
        register struct devdescription **dp = &devtable;
@@ -203,11 +211,25 @@ initdevtable()
                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;
+               }
        }
        *dp = 0;
        fclose(fp);
        }
        *dp = 0;
        fclose(fp);