projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
4.4BSD snapshot (revision 8.1)
[unix-history]
/
usr
/
src
/
usr.bin
/
rdist
/
gram.y
diff --git
a/usr/src/usr.bin/rdist/gram.y
b/usr/src/usr.bin/rdist/gram.y
index
a2dff2d
..
36fd079
100644
(file)
--- a/
usr/src/usr.bin/rdist/gram.y
+++ b/
usr/src/usr.bin/rdist/gram.y
@@
-1,7
+1,14
@@
%{
%{
+/*
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * %sccs.include.redist.c%
+ */
+
#ifndef lint
#ifndef lint
-static char
*sccsid = "@(#)gram.y 4.10 (Berkeley) 84/05/03
";
-#endif
+static char
sccsid[] = "@(#)gram.y 8.1 (Berkeley) %G%
";
+#endif
/* not lint */
#include "defs.h"
#include "defs.h"
@@
-10,6
+17,8
@@
struct cmd *last_cmd;
struct namelist *last_n;
struct subcmd *last_sc;
struct namelist *last_n;
struct subcmd *last_sc;
+static char *makestr __P((char *));
+
%}
%term EQUAL 1
%}
%term EQUAL 1
@@
-106,10
+115,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
+142,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 = {
@@
-162,6
+174,7
@@
opt_namelist: /* VOID */ = {
int yylineno = 1;
extern FILE *fin;
int yylineno = 1;
extern FILE *fin;
+int
yylex()
{
static char yytext[INMAX];
yylex()
{
static char yytext[INMAX];
@@
-284,6
+297,14
@@
again:
case 'y':
yylval.intval = YOUNGER;
return(OPTION);
case 'y':
yylval.intval = YOUNGER;
return(OPTION);
+
+ case 'h':
+ yylval.intval = FOLLOW;
+ return(OPTION);
+
+ case 'i':
+ yylval.intval = IGNLNKS;
+ return(OPTION);
}
}
if (!strcmp(yytext, "install"))
}
}
if (!strcmp(yytext, "install"))
@@
-292,7
+313,7
@@
again:
c = NOTIFY;
else if (!strcmp(yytext, "except"))
c = EXCEPT;
c = NOTIFY;
else if (!strcmp(yytext, "except"))
c = EXCEPT;
- else if (!strcmp(yytext, "ex
p
_pat"))
+ else if (!strcmp(yytext, "ex
cept
_pat"))
c = PATTERN;
else if (!strcmp(yytext, "special"))
c = SPECIAL;
c = PATTERN;
else if (!strcmp(yytext, "special"))
c = SPECIAL;
@@
-304,6
+325,7
@@
again:
return(c);
}
return(c);
}
+int
any(c, str)
register int c;
register char *str;
any(c, str)
register int c;
register char *str;
@@
-317,6
+339,7
@@
any(c, str)
/*
* Insert or append ARROW command to list of hosts to be updated.
*/
/*
* Insert or append ARROW command to list of hosts to be updated.
*/
+void
insert(label, files, hosts, subcmds)
char *label;
struct namelist *files, *hosts;
insert(label, files, hosts, subcmds)
char *label;
struct namelist *files, *hosts;
@@
-367,6
+390,7
@@
insert(label, files, hosts, subcmds)
* Append DCOLON command to the end of the command list since these are always
* executed in the order they appear in the distfile.
*/
* Append DCOLON command to the end of the command list since these are always
* executed in the order they appear in the distfile.
*/
+void
append(label, files, stamp, subcmds)
char *label;
struct namelist *files;
append(label, files, stamp, subcmds)
char *label;
struct namelist *files;
@@
-395,12
+419,11
@@
append(label, files, stamp, subcmds)
/*
* Error printing routine in parser.
*/
/*
* Error printing routine in parser.
*/
+void
yyerror(s)
char *s;
{
yyerror(s)
char *s;
{
- extern int yychar;
-
- nerrs++;
+ ++nerrs;
fflush(stdout);
fprintf(stderr, "rdist: line %d: %s\n", yylineno, s);
}
fflush(stdout);
fprintf(stderr, "rdist: line %d: %s\n", yylineno, s);
}
@@
-408,7
+431,7
@@
yyerror(s)
/*
* Return a copy of the string.
*/
/*
* Return a copy of the string.
*/
-char *
+
static
char *
makestr(str)
char *str;
{
makestr(str)
char *str;
{
@@
-443,11
+466,9
@@
makenl(name)
* Make a sub command for lists of variables, commands, etc.
*/
struct subcmd *
* Make a sub command for lists of variables, commands, etc.
*/
struct subcmd *
-makesubcmd(type
, name
)
+makesubcmd(type)
int type;
int type;
- register char *name;
{
{
- register char *cp;
register struct subcmd *sc;
sc = ALLOC(subcmd);
register struct subcmd *sc;
sc = ALLOC(subcmd);