ALTERNATE_VALUE,
} state = WORD;
- const char *e, *word = format, *test_value;
+ const char *e, *word = format, *test_value = NULL; /* test_value is initialized to appease gcc */
char *k;
_cleanup_free_ char *r = NULL;
- size_t i, len;
+ size_t i, len = 0; /* len is initialized to appease gcc */
int nest = 0;
assert(format);
word = e+1;
state = WORD;
} else if (*e == ':') {
- if (!(flags & REPLACE_ENV_ALLOW_EXTENDED))
+ if (flags & REPLACE_ENV_ALLOW_EXTENDED) {
+ len = e - word - 2;
+ state = TEST;
+ } else
/* Treat this as unsupported syntax, i.e. do no replacement */
state = WORD;
- else {
- len = e-word-2;
- state = TEST;
- }
}
break;