summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2012-09-11 10:31:14 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2012-09-11 10:31:14 +0000
commit143da46fa7d10716180d8883ac3eef1d7b758992 (patch)
tree595ace6e08e6d24f26ccad70041e200d8766cf5d /Build
parent54d5636dd1dd49cf61bf0c6347cf2928e39a22e9 (diff)
On Windows, latex "\input" "a b c", for example, was not allowed. Allow file name with spaces in these cases.
git-svn-id: svn://tug.org/texlive/trunk@27648 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/web2c/lib/ChangeLog5
-rw-r--r--Build/source/texk/web2c/lib/texmfmp.c48
2 files changed, 52 insertions, 1 deletions
diff --git a/Build/source/texk/web2c/lib/ChangeLog b/Build/source/texk/web2c/lib/ChangeLog
index dfd07c9260d..54a52556c8a 100644
--- a/Build/source/texk/web2c/lib/ChangeLog
+++ b/Build/source/texk/web2c/lib/ChangeLog
@@ -1,3 +1,8 @@
+2012-09-11 Akira Kakuto <kakuto@fuk.kindai.ac.jp>
+
+ * texmfmp.c (maininit): On Windows, latex "\input" "a b c", for example,
+ was not allowed. Allow file name with spaces in these cases.
+
2012-08-06 Akira Kakuto <kakuto@fuk.kindai.ac.jp>
* texmfmp.c [WIN32]: bug fix. use rewind (f) to clear error and
diff --git a/Build/source/texk/web2c/lib/texmfmp.c b/Build/source/texk/web2c/lib/texmfmp.c
index d53577c424b..f86eeb4e4fa 100644
--- a/Build/source/texk/web2c/lib/texmfmp.c
+++ b/Build/source/texk/web2c/lib/texmfmp.c
@@ -621,6 +621,11 @@ texmf_yesno(const_string var)
const char *ptexbanner = BANNER;
#endif
+#ifdef WIN32
+string
+normalize_quotes (const_string name, const_string mesg);
+#endif
+
/* The entry point: set up for reading the command line, which will
happen in `topenin', then call the main body. */
@@ -696,6 +701,47 @@ maininit (int ac, string *av)
/* Were we given a simple filename? */
main_input_file = get_input_file_name();
+#ifdef WIN32
+ if (main_input_file == NULL) {
+ string name;
+ boolean quoted;
+
+ name = argv[argc-1];
+ if (name && name[0] != '-' && name[0] != '&' && name[0] != '\\') {
+ if (strlen (name) > 2 && isalpha (name[0]) && name[1] == ':' &&
+ name[2] == '\\') {
+ string pp;
+ for (pp = name; *pp; pp++) {
+ if (IS_KANJI (pp))
+ pp++;
+ else if (*pp == '\\')
+ *pp = '/';
+ }
+ }
+#ifdef XeTeX
+ name = normalize_quotes(argv[argc-1], "argument");
+ main_input_file = kpse_find_file(argv[argc-1], INPUT_FORMAT, false);
+ argv[argc-1] = name;
+#else
+ name = normalize_quotes(argv[argc-1], "argument");
+ quoted = (name[0] == '"');
+ if (quoted) {
+ /* Overwrite last quote and skip first quote. */
+ name[strlen(name)-1] = '\0';
+ name++;
+ }
+ main_input_file = kpse_find_file(name, INPUT_FORMAT, false);
+ if (quoted) {
+ /* Undo modifications */
+ name[strlen(name)] = '"';
+ name--;
+ }
+ argv[argc-1] = name;
+#endif
+ }
+ }
+#endif
+
/* Second chance to activate file:line:error style messages, this
time from texmf.cnf. */
if (filelineerrorstylep < 0) {
@@ -1596,7 +1642,7 @@ parse_options (int argc, string *argv)
unsigned i;
for (i = 0; i < 20 && !ipc_is_open (); i++) {
#ifdef WIN32
- Sleep (2000);
+ Sleep (100); /* 2000ms is too long for a simple w32 example */
#else
sleep (2);
#endif