mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-17 23:08:40 +02:00
Parse arg to INCLUDECMD as a character string, not a sequence of tokens.
This commit is contained in:
26
src/files.c
26
src/files.c
@@ -553,32 +553,28 @@ int DoInclude(ParsePtr p)
|
|||||||
int DoIncludeCmd(ParsePtr p)
|
int DoIncludeCmd(ParsePtr p)
|
||||||
{
|
{
|
||||||
DynamicBuffer buf;
|
DynamicBuffer buf;
|
||||||
DynamicBuffer token;
|
|
||||||
int r;
|
int r;
|
||||||
|
int ch;
|
||||||
|
char append_buf[2];
|
||||||
|
|
||||||
|
append_buf[1] = 0;
|
||||||
|
|
||||||
int done = 0;
|
|
||||||
DBufInit(&buf);
|
DBufInit(&buf);
|
||||||
DBufInit(&token);
|
|
||||||
|
|
||||||
while(1) {
|
while(1) {
|
||||||
if ( (r=ParseToken(p, &token)) ) {
|
ch = ParseChar(p, &r, 0);
|
||||||
|
if (r) {
|
||||||
DBufFree(&buf);
|
DBufFree(&buf);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
if (!*DBufValue(&token)) break;
|
if (!ch) {
|
||||||
if (done) {
|
break;
|
||||||
if (DBufPuts(&buf, " ") != OK) {
|
}
|
||||||
DBufFree(&buf);
|
append_buf[0] = (char) ch;
|
||||||
return E_NO_MEM;
|
if (DBufPuts(&buf, append_buf) != OK) {
|
||||||
}
|
|
||||||
}
|
|
||||||
done = 1;
|
|
||||||
if (DBufPuts(&buf, DBufValue(&token)) != OK) {
|
|
||||||
DBufFree(&buf);
|
DBufFree(&buf);
|
||||||
return E_NO_MEM;
|
return E_NO_MEM;
|
||||||
}
|
}
|
||||||
DBufFree(&token);
|
|
||||||
DBufInit(&token);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( (r=IncludeCmd(DBufValue(&buf))) ) {
|
if ( (r=IncludeCmd(DBufValue(&buf))) ) {
|
||||||
|
|||||||
Reference in New Issue
Block a user