File src/commands.c changed (mode: 100644) (index 1f2ba3149..d7f9fa012) |
... |
... |
expand_macros(FileView *view, const char *command, const char *args, |
2088 |
2088 |
if(p != NULL) |
if(p != NULL) |
2089 |
2089 |
y += (p - (command + x)) + 1; |
y += (p - (command + x)) + 1; |
2090 |
2090 |
else |
else |
2091 |
|
y += strlen(command); |
|
|
2091 |
|
y += strlen(command + y); |
2092 |
2092 |
x = y; |
x = y; |
2093 |
2093 |
continue; |
continue; |
2094 |
2094 |
} |
} |
2095 |
2095 |
} |
} |
2096 |
2096 |
if(command[x] == '%') |
if(command[x] == '%') |
2097 |
2097 |
break; |
break; |
2098 |
|
x++; |
|
|
2098 |
|
if(command[x] != '\0') |
|
2099 |
|
x++; |
2099 |
2100 |
} |
} |
|
2101 |
|
assert(x >= y); |
|
2102 |
|
assert(y <= cmd_len); |
2100 |
2103 |
expanded = realloc(expanded, len + cmd_len + 1); |
expanded = realloc(expanded, len + cmd_len + 1); |
2101 |
2104 |
strncat(expanded, command + y, x - y); |
strncat(expanded, command + y, x - y); |
2102 |
2105 |
len = strlen(expanded); |
len = strlen(expanded); |