summaryrefslogtreecommitdiff
path: root/sys/src/cmd/upas
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2016-05-13 11:13:26 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2016-05-13 11:13:26 +0200
commit63a14bfe8abf53384070fcf068aa3458eaf68a6e (patch)
treeaac173ae8db61d6545ea98b4748ba0f2b0584b0e /sys/src/cmd/upas
parent675ee1db15ca969a4b03718cf71af8d4589f0306 (diff)
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.
Diffstat (limited to 'sys/src/cmd/upas')
-rw-r--r--sys/src/cmd/upas/marshal/marshal.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/src/cmd/upas/marshal/marshal.c b/sys/src/cmd/upas/marshal/marshal.c
index b25256801..f62fc9e28 100644
--- a/sys/src/cmd/upas/marshal/marshal.c
+++ b/sys/src/cmd/upas/marshal/marshal.c
@@ -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;
}