/[make]/make/function.c
ViewVC logotype

Diff of /make/function.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.77 by psmith, Fri May 2 01:44:59 2003 UTC revision 1.78 by psmith, Tue Nov 4 07:40:29 2003 UTC
# Line 678  func_words (char *o, char **argv, const Line 678  func_words (char *o, char **argv, const
678    return o;    return o;
679  }  }
680    
681    /* Set begpp to point to the first non-whitespace character of the string,
682     * and endpp to point to the last non-whitespace character of the string.
683     * If the string is empty or contains nothing but whitespace, endpp will be
684     * begpp-1.
685     */
686  static char *  static char *
687  strip_whitespace (const char **begpp, const char **endpp)  strip_whitespace (const char **begpp, const char **endpp)
688  {  {
# Line 1134  static char * Line 1139  static char *
1139  func_if (char *o, char **argv, const char *funcname)  func_if (char *o, char **argv, const char *funcname)
1140  {  {
1141    const char *begp = argv[0];    const char *begp = argv[0];
1142    const char *endp = begp + strlen (argv[0]);    const char *endp = begp + strlen (argv[0]) - 1;
1143    int result = 0;    int result = 0;
1144    
1145    /* Find the result of the condition: if we have a value, and it's not    /* Find the result of the condition: if we have a value, and it's not
# Line 1143  func_if (char *o, char **argv, const cha Line 1148  func_if (char *o, char **argv, const cha
1148    
1149    strip_whitespace (&begp, &endp);    strip_whitespace (&begp, &endp);
1150    
1151    if (begp < endp)    if (begp <= endp)
1152      {      {
1153        char *expansion = expand_argument (begp, NULL);        char *expansion = expand_argument (begp, endp+1);
1154    
1155        result = strlen (expansion);        result = strlen (expansion);
1156        free (expansion);        free (expansion);

Legend:
Removed from v.1.77  
changed lines
  Added in v.1.78

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26