Install sccs headers and copyright notices.
[unix-history] / usr / src / usr.bin / tn3270 / tools / mkmake.y
index 086bf5c..1e27b35 100644 (file)
@@ -1,4 +1,26 @@
 %{
 %{
+
+/*
+ *     Copyright (c) 1984-1987 by the Regents of the
+ *     University of California and by Gregory Glenn Minshall.
+ *
+ *     Permission to use, copy, modify, and distribute these
+ *     programs and their documentation for any purpose and
+ *     without fee is hereby granted, provided that this
+ *     copyright and permission appear on all copies and
+ *     supporting documentation, the name of the Regents of
+ *     the University of California not be used in advertising
+ *     or publicity pertaining to distribution of the programs
+ *     without specific prior permission, and notice be given in
+ *     supporting documentation that copying and distribution is
+ *     by permission of the Regents of the University of California
+ *     and by Gregory Glenn Minshall.  Neither the Regents of the
+ *     University of California nor Gregory Glenn Minshall make
+ *     representations about the suitability of this software
+ *     for any purpose.  It is provided "as is" without
+ *     express or implied warranty.
+ */
+
 typedef struct string {
     int
        hashval,
 typedef struct string {
     int
        hashval,
@@ -127,7 +149,7 @@ action:     white_space command_list NL
 for_statement: maybe_at_minus FOR white_space token
                in tokens semi_colon
     {
 for_statement: maybe_at_minus FOR white_space token
                in tokens semi_colon
     {
-       $$ = for_statement($1, $4, expand_variables($6, 0));
+       $$ = for_statement($1, $4, ws_merge(expand_variables($6, 0)));
     }
     ;
 
     }
     ;
 
@@ -667,14 +689,14 @@ int       free;
        char *string = token->string->string;
        same_t *tmp = same_unlink(token);
 
        char *string = token->string->string;
        same_t *tmp = same_unlink(token);
 
-       if ((string[0] == '$') && (string[1] == '{')) {/* '}' Expand time */
+       if ((string[0] == '$') && (string[1] == '{')) { /* Expand time */
            int len = strlen(string);
 
            string[len-1] = 0;
            head = same_cat(head, expand_variables(
                        value_of(same_item(string_lookup(string+2))), 1));
            string[len-1] = '}';
            int len = strlen(string);
 
            string[len-1] = 0;
            head = same_cat(head, expand_variables(
                        value_of(same_item(string_lookup(string+2))), 1));
            string[len-1] = '}';
-       } else if (!isspace(string[0])) {
+       } else {
            head = same_cat(head, token);
        }
        token = tmp;
            head = same_cat(head, token);
        }
        token = tmp;
@@ -935,7 +957,12 @@ yylex()
            Return(c,c);
        case '\'':
        case '"':
            Return(c,c);
        case '\'':
        case '"':
-           {
+           if (bufptr != buffer) {
+               if (bufptr[-1] == '\\') {
+                   bufptr[-1] = c;
+               }
+               break;
+           } else {
                int newc;
 
                ret_token(c);
                int newc;
 
                ret_token(c);