diff options
Diffstat (limited to 'expand.c')
-rw-r--r-- | expand.c | 21 |
1 files changed, 10 insertions, 11 deletions
@@ -1,5 +1,5 @@ /* Variable expansion functions for GNU Make. -Copyright (C) 1988-2014 Free Software Foundation, Inc. +Copyright (C) 1988-2016 Free Software Foundation, Inc. This file is part of GNU Make. GNU Make is free software; you can redistribute it and/or modify it under the @@ -26,7 +26,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */ /* Initially, any errors reported when expanding strings will be reported against the file where the error appears. */ -const gmk_floc **expanding_var = &reading_file; +const floc **expanding_var = &reading_file; /* The next two describe the variable output buffer. This buffer is used to hold the variable-expansion of a line of the @@ -96,8 +96,8 @@ char * recursively_expand_for_file (struct variable *v, struct file *file) { char *value; - const gmk_floc *this_var; - const gmk_floc **saved_varp; + const floc *this_var; + const floc **saved_varp; struct variable_set_list *save = 0; int set_reading = 0; @@ -235,8 +235,10 @@ variable_expand_string (char *line, const char *string, long length) switch (*p) { case '$': - /* $$ seen means output one $ to the variable output buffer. */ - o = variable_buffer_output (o, p, 1); + case '\0': + /* $$ or $ at the end of the string means output one $ to the + variable output buffer. */ + o = variable_buffer_output (o, p1, 1); break; case '(': @@ -381,11 +383,8 @@ variable_expand_string (char *line, const char *string, long length) } break; - case '\0': - break; - default: - if (isblank ((unsigned char)p[-1])) + if (ISSPACE (p[-1])) break; /* A $ followed by a random char is a variable reference: @@ -459,7 +458,7 @@ variable_expand_for_file (const char *line, struct file *file) { char *result; struct variable_set_list *savev; - const gmk_floc *savef; + const floc *savef; if (file == 0) return variable_expand (line); |