Made prefix right.
authorMichael Toy <toy@ucbvax.Berkeley.EDU>
Thu, 26 Feb 1981 14:27:54 +0000 (06:27 -0800)
committerMichael Toy <toy@ucbvax.Berkeley.EDU>
Thu, 26 Feb 1981 14:27:54 +0000 (06:27 -0800)
SCCS-vsn: usr.sbin/config/main.c 1.2
SCCS-vsn: usr.sbin/config/config.h 1.2

usr/src/usr.sbin/config/config.h
usr/src/usr.sbin/config/main.c

index abd569f..e42f710 100644 (file)
@@ -1,11 +1,9 @@
 /*
 /*
- * config.h    1.1     81/02/25
+ * config.h    1.2     81/02/25
  * Definitions that everybody needs to know
  */
 
 #define eq(a,b) (strcmp(a,b) == 0)
  * Definitions that everybody needs to know
  */
 
 #define eq(a,b) (strcmp(a,b) == 0)
-#define PREFIX "_unix/"
-#define path(file) "_unix/file"
 #define TRUE 1
 #define FALSE 0
 #define DRIVER 1
 #define TRUE 1
 #define FALSE 0
 #define DRIVER 1
@@ -48,3 +46,4 @@ struct device *dtab;
 char errbuf[80];
 int yyline;
 struct file_list *ftab, *conf_list, *confp;
 char errbuf[80];
 int yyline;
 struct file_list *ftab, *conf_list, *confp;
+char *PREFIX;
index 3c1358a..0ca4e59 100644 (file)
@@ -1,5 +1,5 @@
 /*
 /*
- * main.c      1.1     81/02/24
+ * main.c      1.2     81/02/25
  * Config
  *     Do system configuration for VAX/UNIX
  *             1) Build system data structures
  * Config
  *     Do system configuration for VAX/UNIX
  *             1) Build system data structures
@@ -22,6 +22,7 @@ char **argv;
        fprintf(stderr, "usage: config <sysname>\n");
        exit(1);
     }
        fprintf(stderr, "usage: config <sysname>\n");
        exit(1);
     }
+    PREFIX = argv[1];
     if (freopen(argv[1], "r", stdin) == NULL)
     {
        perror(argv[1]);
     if (freopen(argv[1], "r", stdin) == NULL)
     {
        perror(argv[1]);
@@ -74,3 +75,19 @@ register FILE *fp;
     ungetc(ch, fp);
     return line;
 }
     ungetc(ch, fp);
     return line;
 }
+
+/*
+ * path:
+ *     Prepend the path to a filename
+ */
+
+path(file)
+char *file;
+{
+    register char *cp;
+
+    cp = malloc(strlen(PREFIX)+strlen(file)+1);
+    strcpy(cp, PREFIX);
+    strcpy(cp, file);
+    return cp;
+}