From 2955d47562cb9423130327ebbb4493f62e9d6d7d Mon Sep 17 00:00:00 2001 From: Akira Kakuto Date: Mon, 24 May 2010 15:38:40 +0000 Subject: correct the previous change. git-svn-id: svn://tug.org/texlive/trunk@18448 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/web2c/lib/texmfmp.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Build/source/texk/web2c/lib/texmfmp.c b/Build/source/texk/web2c/lib/texmfmp.c index f2b9161a7dd..6bfe2ea1338 100644 --- a/Build/source/texk/web2c/lib/texmfmp.c +++ b/Build/source/texk/web2c/lib/texmfmp.c @@ -415,14 +415,18 @@ shell_cmd_is_allowed (const char *cmd, char **safecmd, char **cmdname) r = *safecmd; while (*r && !Isspace(*r)) r++; - *r = '\0'; - r++; - while (*r && Isspace(*r)) - r++; - if (*r) - q = (char *) concatn ("\"", p, "/", *safecmd, "\" ", r, NULL); - else + if (*r == '\0') q = (char *) concatn ("\"", p, "/", *safecmd, "\"", NULL); + else { + *r = '\0'; + r++; + while (*r && Isspace(*r)) + r++; + if (*r) + q = (char *) concatn ("\"", p, "/", *safecmd, "\" ", r, NULL); + else + q = (char *) concatn ("\"", p, "/", *safecmd, "\"", NULL); + } free (p); free (*safecmd); *safecmd = q; -- cgit v1.2.3