stdio.h defines BUFSIZ
[unix-history] / usr / src / usr.bin / rdist / gram.y
index 3a9c0bf..6c47775 100644 (file)
@@ -1,7 +1,14 @@
 %{
 %{
+/*
+ * Copyright (c) 1983 Regents of the University of California.
+ * All rights reserved.
+ *
+ * %sccs.include.redist.c%
+ */
+
 #ifndef lint
 #ifndef lint
-static char *sccsid = "@(#)gram.y      4.12 (Berkeley) 85/02/04";
-#endif
+static char sccsid[] = "@(#)gram.y     5.6 (Berkeley) %G%";
+#endif /* not lint */
 
 #include "defs.h"
 
 
 #include "defs.h"
 
@@ -106,10 +113,13 @@ cmd:                INSTALL options opt_namelist SM = {
                        $1->sc_options = $2 | options;
                        if ($3 != NULL) {
                                nl = expand($3, E_VARS);
                        $1->sc_options = $2 | options;
                        if ($3 != NULL) {
                                nl = expand($3, E_VARS);
-                               if (nl->n_next != NULL)
-                                       yyerror("only one name allowed\n");
-                               $1->sc_name = nl->n_name;
-                               free(nl);
+                               if (nl) {
+                                       if (nl->n_next != NULL)
+                                           yyerror("only one name allowed\n");
+                                       $1->sc_name = nl->n_name;
+                                       free(nl);
+                               } else
+                                       $1->sc_name = NULL;
                        }
                        $$ = $1;
                }
                        }
                        $$ = $1;
                }
@@ -130,7 +140,7 @@ cmd:                  INSTALL options opt_namelist SM = {
                        for (nl = $2; nl != NULL; nl = nl->n_next)
                                if ((cp = re_comp(nl->n_name)) != NULL)
                                        yyerror(cp);
                        for (nl = $2; nl != NULL; nl = nl->n_next)
                                if ((cp = re_comp(nl->n_name)) != NULL)
                                        yyerror(cp);
-                       $1->sc_args = $2;
+                       $1->sc_args = expand($2, E_VARS);
                        $$ = $1;
                }
                | SPECIAL opt_namelist STRING SM = {
                        $$ = $1;
                }
                | SPECIAL opt_namelist STRING SM = {