upas/marshal: strip trailing whitespace from header values

when using rio auto-complete to resolve file names for the "attach:" and
"include:" headers, the auto-completer might leave whitespaces at
the end of the line which leads upas/marshal to not find the file.
This commit is contained in:
cinap_lenrek 2016-05-13 11:13:26 +02:00
parent 675ee1db15
commit 63a14bfe8a

View file

@ -1847,9 +1847,14 @@ hard:
char*
hdrval(char *p)
{
char *e;
p = strchr(p, ':') + 1;
while(*p == ' ' || *p == '\t')
p++;
e = strchr(p, 0) - 1;
while(e >= p && (*e == ' ' || *e == '\t'))
*e-- = 0;
return p;
}