diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2011-09-01 08:47:27 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2011-09-01 08:47:27 +0000 |
commit | 9d036a3820950488da5994b9d1ba7e9a390b44b5 (patch) | |
tree | 3de74a090c6b30dafb66dbd9d1bb108356360513 /Build | |
parent | 3e64fbfc1f8dd70d638c72d5496283ea8866564a (diff) |
WIN32: Minor rewrite to reduce diffs with W32TeX
git-svn-id: svn://tug.org/texlive/trunk@23767 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r-- | Build/source/texk/web2c/lib/ChangeLog | 4 | ||||
-rw-r--r-- | Build/source/texk/web2c/lib/texmfmp.c | 27 |
2 files changed, 26 insertions, 5 deletions
diff --git a/Build/source/texk/web2c/lib/ChangeLog b/Build/source/texk/web2c/lib/ChangeLog index dfcc3f1041e..b3779e137d3 100644 --- a/Build/source/texk/web2c/lib/ChangeLog +++ b/Build/source/texk/web2c/lib/ChangeLog @@ -1,3 +1,7 @@ +2011-09-01 Peter Breitenlohner <peb@mp.mpg.de> + + * texmfmp.c [WIN32]: Minor rewrite to reduce diffs with W32TeX. + 2011-08-30 Akira Kakuto <kakuto@fuk.kindai.ac.jp> * texmfmp.c [WIN32]: Remove a semicolon. diff --git a/Build/source/texk/web2c/lib/texmfmp.c b/Build/source/texk/web2c/lib/texmfmp.c index b277dca3f3c..ddacc5190b3 100644 --- a/Build/source/texk/web2c/lib/texmfmp.c +++ b/Build/source/texk/web2c/lib/texmfmp.c @@ -811,6 +811,7 @@ main (int ac, string *av) #ifdef WIN32 _setmaxstdio(2048); + setmode(fileno(stdin), _O_BINARY); #endif maininit (ac, av); @@ -1301,13 +1302,29 @@ get_input_file_name (void) if (argv[optind] && argv[optind][0] != '&' && argv[optind][0] != '\\') { /* Not &format, not \input, so assume simple filename. */ + string name; +#ifndef XeTeX + boolean quoted; +#endif + +#ifdef WIN32 + if (strlen (argv[optind]) > 2 && isalpha (argv[optind][0]) && + argv[optind][1] == ':' && argv[optind][2] == '\\') { + char *pp; + for (pp = argv[optind]; *pp; pp++) { + if (*pp == '\\') + *pp = '/'; + else if (IS_KANJI(pp)) + pp++; + } + } +#endif + + name = normalize_quotes(argv[optind], "argument"); #ifdef XeTeX - string name = normalize_quotes(argv[optind], "argument"); input_file_name = kpse_find_file(argv[optind], INPUT_FORMAT, false); - argv[optind] = name; #else - string name = normalize_quotes(argv[optind], "argument"); - boolean quoted = (name[0] == '"'); + quoted = (name[0] == '"'); if (quoted) { /* Overwrite last quote and skip first quote. */ name[strlen(name)-1] = '\0'; @@ -1319,8 +1336,8 @@ get_input_file_name (void) name[strlen(name)] = '"'; name--; } - argv[optind] = name; #endif + argv[optind] = name; } return input_file_name; } |