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

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/usr.bin/make/var.c between version 1.737 and 1.738

version 1.737, 2020/12/19 22:10:17 version 1.738, 2020/12/20 00:47:21
Line 2813  ok:
Line 2813  ok:
         return AMR_OK;          return AMR_OK;
 }  }
   
   static char *
   str_toupper(const char *str)
   {
           char *res;
           size_t i, len;
   
           len = strlen(str);
           res = bmake_malloc(len + 1);
           for (i = 0; i < len + 1; i++)
                   res[i] = ch_toupper(str[i]);
   
           return res;
   }
   
   static char *
   str_tolower(const char *str)
   {
           char *res;
           size_t i, len;
   
           len = strlen(str);
           res = bmake_malloc(len + 1);
           for (i = 0; i < len + 1; i++)
                   res[i] = ch_tolower(str[i]);
   
           return res;
   }
   
 /* :tA, :tu, :tl, :ts<separator>, etc. */  /* :tA, :tu, :tl, :ts<separator>, etc. */
 static ApplyModifierResult  static ApplyModifierResult
 ApplyModifier_To(const char **pp, ApplyModifiersState *st)  ApplyModifier_To(const char **pp, ApplyModifiersState *st)
Line 2842  ApplyModifier_To(const char **pp, ApplyM
Line 2870  ApplyModifier_To(const char **pp, ApplyM
         }          }
   
         if (mod[1] == 'u') {    /* :tu */          if (mod[1] == 'u') {    /* :tu */
                 size_t i;                  st->newVal = str_toupper(st->val);
                 size_t len = strlen(st->val);  
                 st->newVal = bmake_malloc(len + 1);  
                 for (i = 0; i < len + 1; i++)  
                         st->newVal[i] = ch_toupper(st->val[i]);  
                 *pp = mod + 2;                  *pp = mod + 2;
                 return AMR_OK;                  return AMR_OK;
         }          }
   
         if (mod[1] == 'l') {    /* :tl */          if (mod[1] == 'l') {    /* :tl */
                 size_t i;                  st->newVal = str_tolower(st->val);
                 size_t len = strlen(st->val);  
                 st->newVal = bmake_malloc(len + 1);  
                 for (i = 0; i < len + 1; i++)  
                         st->newVal[i] = ch_tolower(st->val[i]);  
                 *pp = mod + 2;                  *pp = mod + 2;
                 return AMR_OK;                  return AMR_OK;
         }          }

Legend:
Removed from v.1.737  
changed lines
  Added in v.1.738

CVSweb <webmaster@jp.NetBSD.org>