aboutsummaryrefslogtreecommitdiff
path: root/gram.y
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2013-03-04 21:44:25 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2013-03-04 21:44:25 +0200
commita75760ff7d9bedcb1377fc3441f5e38178da1d6a (patch)
tree39413a06ee259848dfc2cb585a357ddac5d2d4ca /gram.y
parent860ec4960ff61cf3b2e98e0d020e7f8a93a56008 (diff)
downloadalck-a75760ff7d9bedcb1377fc3441f5e38178da1d6a.tar.gz
alck-a75760ff7d9bedcb1377fc3441f5e38178da1d6a.tar.bz2
Switch to a "right" style.
Diffstat (limited to 'gram.y')
-rw-r--r--gram.y28
1 files changed, 10 insertions, 18 deletions
diff --git a/gram.y b/gram.y
index dd323be..34d46e2 100644
--- a/gram.y
+++ b/gram.y
@@ -76,14 +76,13 @@ emails: email
$$ = $1;
}
;
email : string
{
- if (restricted && ($1[0] == '|' || $1[0] == '/'))
- {
+ if (restricted && ($1[0] == '|' || $1[0] == '/')) {
yyerror("Construct not allowed");
YYERROR;
}
$$ = NULL;
slist_add(&$$, $1);
}
@@ -91,14 +90,13 @@ email : string
{
$$ = NULL;
slist_add(&$$, $1);
}
| INCLUDE string
{
- if (restricted)
- {
+ if (restricted) {
yyerror("Include statement is not allowed");
YYERROR;
}
$$ = NULL;
read_include(&$$, $2);
}
@@ -166,29 +164,26 @@ main (int argc, char **argv)
SLIST *file_list; /* List of files to be read */
struct string_list *s;
begin_aliases();
init_lex ();
program_name = argv[0];
- while ((c = getopt_long (argc, argv, "-d:f:hp:ruvw:", options, NULL)) != EOF)
- {
- switch (c)
- {
+ while ((c = getopt_long(argc, argv, "-d:f:hp:ruvw:",
+ options, NULL)) != EOF) {
+ switch (c) {
case 1:
if (!cw_list)
read_include(&cw_list, cwfile);
openaliases(optarg);
yyparse();
file_count++;
break;
case 'd':
- for (p = optarg; *p; p++)
- {
- switch (*p)
- {
+ for (p = optarg; *p; p++) {
+ switch (*p) {
case '-':
true = 0;
break;
case 'y':
case 'Y':
@@ -210,16 +205,14 @@ main (int argc, char **argv)
case 'f':
if (!cw_list)
read_include(&cw_list, cwfile);
file_list = NULL;
read_include(&file_list, optarg);
- if (file_list)
- {
- for (s = file_list->head; s; s = s->next)
- {
+ if (file_list) {
+ for (s = file_list->head; s; s = s->next) {
openaliases_prefix(optarg, s->str);
yyparse();
file_count++;
}
slist_destroy(&file_list);
}
@@ -258,14 +251,13 @@ main (int argc, char **argv)
argc -= optind;
argv += optind;
if (!cw_list)
read_include(&cw_list, cwfile);
- while (argc--)
- {
+ while (argc--) {
openaliases(*argv++);
yyparse();
file_count++;
}
if (!file_count)

Return to:

Send suggestions and report system problems to the System administrator.