[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.35 and 1.36

version 1.35, 2000/06/23 16:20:01 version 1.36, 2000/06/23 16:21:44
Line 385 
Line 385 
      * look for it in VAR_CMD, VAR_GLOBAL and the environment, in that order,       * look for it in VAR_CMD, VAR_GLOBAL and the environment, in that order,
      * depending on the FIND_* flags in 'flags'       * depending on the FIND_* flags in 'flags'
      */       */
     var = Lst_Find(ctxt, VarCmp, name);      if (ctxt != NULL)
           var = Lst_Find(ctxt, VarCmp, name);
       else
           var = NULL;
   
     if ((var == NULL) && (flags & FIND_CMD) && (ctxt != VAR_CMD))      if ((var == NULL) && (flags & FIND_CMD) && (ctxt != VAR_CMD))
         var = Lst_Find(VAR_CMD, VarCmp, name);          var = Lst_Find(VAR_CMD, VarCmp, name);
Line 1541 
Line 1544 
         if (v == NULL) {          if (v == NULL) {
             *lengthPtr = 2;              *lengthPtr = 2;
   
             if ((ctxt == VAR_CMD) || (ctxt == VAR_GLOBAL)) {              if (ctxt == VAR_CMD || ctxt == VAR_GLOBAL || ctxt == NULL) {
                 /*                  /*
                  * If substituting a local variable in a non-local context,                   * If substituting a local variable in a non-local context,
                  * assume it's for dynamic source stuff. We have to handle                   * assume it's for dynamic source stuff. We have to handle
Line 1600 
Line 1603 
         *tstr = '\0';          *tstr = '\0';
   
         v = VarFind (str + 2, ctxt, FIND_ENV | FIND_GLOBAL | FIND_CMD);          v = VarFind (str + 2, ctxt, FIND_ENV | FIND_GLOBAL | FIND_CMD);
         if ((v == NULL) && (ctxt != VAR_CMD) && (ctxt != VAR_GLOBAL) &&          if (v == NULL && ctxt != VAR_CMD && ctxt != VAR_GLOBAL &&
             ((tstr-str) == 4) && (str[3] == 'F' || str[3] == 'D'))              ctxt != NULL &&
               (tstr-str) == 4 && (str[3] == 'F' || str[3] == 'D'))
         {          {
             /*              /*
              * Check for bogus D and F forms of local variables since we're               * Check for bogus D and F forms of local variables since we're
Line 1653 
Line 1657 
         }          }
   
         if (v == NULL) {          if (v == NULL) {
             if ((((tstr-str) == 3) ||              if ((tstr-str == 3 ||
                  ((((tstr-str) == 4) && (str[3] == 'F' ||                   ((tstr-str == 4 && (str[3] == 'F' ||
                                          str[3] == 'D')))) &&                                           str[3] == 'D')))) &&
                 ((ctxt == VAR_CMD) || (ctxt == VAR_GLOBAL)))                  (ctxt == VAR_CMD || ctxt == VAR_GLOBAL || ctxt == NULL))
             {              {
                 /*                  /*
                  * If substituting a local variable in a non-local context,                   * If substituting a local variable in a non-local context,
Line 1677 
Line 1681 
                 }                  }
             } else if (((tstr-str) > 4) && (str[2] == '.') &&              } else if (((tstr-str) > 4) && (str[2] == '.') &&
                        isupper((unsigned char) str[3]) &&                         isupper((unsigned char) str[3]) &&
                        ((ctxt == VAR_CMD) || (ctxt == VAR_GLOBAL)))                         (ctxt == VAR_CMD || ctxt == VAR_GLOBAL || ctxt == NULL))
             {              {
                 int     len;                  int     len;
   

Legend:
Removed from v.1.35  
changed lines
  Added in v.1.36