[BACK]Return to var.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / make

Diff for /src/usr.bin/make/var.c between version 1.45 and 1.46

version 1.45, 2000/07/17 23:29:35 version 1.46, 2000/07/18 20:17:20
Line 1186 
Line 1186 
                 VarPrintVar(v);                  VarPrintVar(v);
 }  }
   
   
   #ifdef POSIX
   
   static const char *quotable = " \t\n\\'\"";
   
   /* In POSIX mode, variable assignments passed on the command line are
    * propagated to sub makes through MAKEFLAGS.
    */
   void
   Var_AddCmdline(name)
           const char *name;
   {
       Var *v;
       unsigned int i;
       BUFFER buf;
       char *s;
   
       Buf_Init(&buf, MAKE_BSIZE);
   
       for (v = hash_first(VAR_CMD, &i); v != NULL;
           v = hash_next(VAR_CMD, &i)) {
                   /* We assume variable names don't need quoting */
                   Buf_AddString(&buf, v->name);
                   Buf_AddChar(&buf, '=');
                   for (s = VarValue(v); *s != '\0'; s++) {
                           if (strchr(quotable, *s))
                                   Buf_AddChar(&buf, '\\');
                           Buf_AddChar(&buf, *s);
                   }
                   Buf_AddSpace(&buf);
       }
       Var_Append(name, Buf_Retrieve(&buf), VAR_GLOBAL);
       Buf_Destroy(&buf);
   }
   #endif

Legend:
Removed from v.1.45  
changed lines
  Added in v.1.46