summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2015-10-31 23:11:17 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2015-10-31 23:11:17 +0000
commite84a6141dfc13cb986d9ce1f0fe8c68eef674803 (patch)
treeed8a1df68de0e5b3dc697f20d8643736bbdcfb47 /Build
parentaeec4f72499a8a08103446203ccecc512ff047ae (diff)
web2c/luatexdir/luatex.c: Improve a little (w32 only).
git-svn-id: svn://tug.org/texlive/trunk@38749 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/web2c/luatexdir/ChangeLog1
-rw-r--r--Build/source/texk/web2c/luatexdir/luatex.c23
2 files changed, 20 insertions, 4 deletions
diff --git a/Build/source/texk/web2c/luatexdir/ChangeLog b/Build/source/texk/web2c/luatexdir/ChangeLog
index 7719ca4a8cf..bd35c8fd881 100644
--- a/Build/source/texk/web2c/luatexdir/ChangeLog
+++ b/Build/source/texk/web2c/luatexdir/ChangeLog
@@ -1,6 +1,7 @@
2015-10-31 Akira Kakuto <kakuto@fuk.kindai.ac.jp>
* tex/inputstack.w: Sync with the upstream.
+ * luatex.c: Improve a little (w32 only).
2015-10-13 Akira Kakuto <kakuto@fuk.kindai.ac.jp>
diff --git a/Build/source/texk/web2c/luatexdir/luatex.c b/Build/source/texk/web2c/luatexdir/luatex.c
index e00fc8acc5c..daa6483cd45 100644
--- a/Build/source/texk/web2c/luatexdir/luatex.c
+++ b/Build/source/texk/web2c/luatexdir/luatex.c
@@ -81,8 +81,7 @@ const char *engine_name = my_name; /* the name of this engine */
Internally, all arguments are quoted by ' (Unix) or " (Windows)
before calling the system() function in order to forbid execution
- of any embedded command. In addition, on Windows, special
- characters of cmd.exe are escaped by using (^).
+ of any embedded command.
If the --shell-escape option is given, we set
shellenabledp = 1 and restrictedshell = 0, i.e., any command is allowed.
@@ -289,10 +288,20 @@ int shell_cmd_is_allowed(const char *cmd, char **safecmd, char **cmdname)
example:
--format="other text files" becomes
'--format=''other text files' (Unix)
- "--format=""other test files" (Windows) */
+ "--format"="other text files" (Windows) */
- if (pre == 0)
+ if (pre == 0) {
+# ifdef WIN32
+ if (*(s-1) == '=') {
+ *(d-1) = QUOTE;
+ *d++ = '=';
+ } else {
+ *d++ = QUOTE;
+ }
+# else
*d++ = QUOTE;
+# endif
+ }
pre = 0;
/* output the quotation mark for the quoted argument */
@@ -303,10 +312,12 @@ int shell_cmd_is_allowed(const char *cmd, char **safecmd, char **cmdname)
/* Illegal use of ', or closing quotation mark is missing */
if (*s == '\'' || *s == '\0')
return -1;
+# if 0
# ifdef WIN32
if (char_needs_quote(*s))
*d++ = '^';
# endif
+# endif
*d++ = *s++;
}
@@ -323,10 +334,12 @@ int shell_cmd_is_allowed(const char *cmd, char **safecmd, char **cmdname)
} else if (pre == 1 && !Isspace(*s)) {
pre = 0;
*d++ = QUOTE;
+# if 0
# ifdef WIN32
if (char_needs_quote(*s))
*d++ = '^';
# endif
+# endif
*d++ = *s++;
/* Ending of a usual argument */
@@ -337,10 +350,12 @@ int shell_cmd_is_allowed(const char *cmd, char **safecmd, char **cmdname)
*d++ = *s++;
} else {
/* Copy a character from cmd to *safecmd. */
+# if 0
# ifdef WIN32
if (char_needs_quote(*s))
*d++ = '^';
# endif
+# endif
*d++ = *s++;
}
}