1
0
Fork 0
mirror of https://github.com/pygos/init.git synced 2024-05-08 06:46:14 +02:00

rdline: always do substitution of '%%'

Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
This commit is contained in:
David Oberhollenzer 2018-11-13 19:11:33 +01:00
parent 7ee95668ca
commit dc6358b0e1

View file

@ -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) {