mirror of
https://github.com/pygos/init.git
synced 2024-11-05 04:07:10 +01:00
rdline: always do substitution of '%%'
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
This commit is contained in:
parent
7ee95668ca
commit
dc6358b0e1
1 changed files with 5 additions and 1 deletions
|
@ -142,6 +142,8 @@ static void substitute(rdline_t *t, char *dst, char *src)
|
|||
*(dst++) = *(src++);
|
||||
}
|
||||
}
|
||||
|
||||
*(dst++) = '\0';
|
||||
}
|
||||
|
||||
int rdline(rdline_t *t)
|
||||
|
@ -156,8 +158,10 @@ int rdline(rdline_t *t)
|
|||
goto out;
|
||||
} while (t->line[0] == '\0');
|
||||
|
||||
if (ret == 0)
|
||||
if (ret == 0) {
|
||||
substitute(t, t->line, t->line);
|
||||
return 0;
|
||||
}
|
||||
|
||||
buffer = calloc(1, strlen(t->line) + ret + 1);
|
||||
if (buffer == NULL) {
|
||||
|
|
Loading…
Reference in a new issue