summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2014-06-20 02:53:16 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2014-06-20 02:53:16 +0000
commit1582a7c12c48f8f039e42e3659c23ff55a903446 (patch)
tree07816a9bbcdc9d4574bb0a662296e99eb9bf015f /Build
parentd5af5d02947dc6f41f2d875e544e0535beec19bc (diff)
Support short-file-name convention (w32 only)
git-svn-id: svn://tug.org/texlive/trunk@34329 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/web2c/lib/ChangeLog4
-rw-r--r--Build/source/texk/web2c/lib/texmfmp.c41
2 files changed, 44 insertions, 1 deletions
diff --git a/Build/source/texk/web2c/lib/ChangeLog b/Build/source/texk/web2c/lib/ChangeLog
index 6b208404b3e..65bb8a31c70 100644
--- a/Build/source/texk/web2c/lib/ChangeLog
+++ b/Build/source/texk/web2c/lib/ChangeLog
@@ -1,3 +1,7 @@
+2014-06-20 Akira Kakuto <kakuto@fuk.kinidai.ac.jp>
+
+ * texmfmp.c: Support short-file-name convention (w32 only).
+
2014-05-06 Peter Breitenlohner <peb@mppmu.mpg.de>
Update to e-pTeX and e-upTeX from Akira Kakuto.
diff --git a/Build/source/texk/web2c/lib/texmfmp.c b/Build/source/texk/web2c/lib/texmfmp.c
index d6cdb401136..f0b7ab9d033 100644
--- a/Build/source/texk/web2c/lib/texmfmp.c
+++ b/Build/source/texk/web2c/lib/texmfmp.c
@@ -619,9 +619,26 @@ const char *ptexbanner = BANNER;
#endif
#ifdef WIN32
+/* forward declaration */
static string
normalize_quotes (const_string name, const_string mesg);
-#endif
+
+/* Support of 8.3-name convention. If *buffer == NULL, nothing is done. */
+static void change_to_long_name (char **buffer)
+{
+ if (*buffer) {
+ char inbuf[260];
+ char outbuf[260];
+
+ memset (outbuf, 0, 260);
+ strcpy (inbuf, *buffer);
+ if (GetLongPathName (inbuf, outbuf, 260)) {
+ *buffer = (char *)realloc(*buffer, strlen(outbuf) + 1);
+ strcpy (*buffer, outbuf);
+ }
+ }
+}
+#endif /* WIN32 */
/* The entry point: set up for reading the command line, which will
happen in `topenin', then call the main body. */
@@ -731,6 +748,11 @@ maininit (int ac, string *av)
#ifdef XeTeX
name = normalize_quotes(argv[argc-1], "argument");
main_input_file = kpse_find_file(argv[argc-1], INPUT_FORMAT, false);
+#ifdef WIN32
+ change_to_long_name (&main_input_file);
+ if (main_input_file)
+ name = normalize_quotes(main_input_file, "argument");
+#endif
argv[argc-1] = name;
#else
name = normalize_quotes(argv[argc-1], "argument");
@@ -741,11 +763,18 @@ maininit (int ac, string *av)
name++;
}
main_input_file = kpse_find_file(name, INPUT_FORMAT, false);
+#ifdef WIN32
+ change_to_long_name (&main_input_file);
+#endif
if (quoted) {
/* Undo modifications */
name[strlen(name)] = '"';
name--;
}
+#ifdef WIN32
+ if (main_input_file)
+ name = normalize_quotes(main_input_file, "argument");
+#endif
argv[argc-1] = name;
#endif
}
@@ -1467,6 +1496,9 @@ get_input_file_name (void)
name = normalize_quotes(argv[optind], "argument");
#ifdef XeTeX
input_file_name = kpse_find_file(argv[optind], INPUT_FORMAT, false);
+#ifdef WIN32
+ change_to_long_name (&input_file_name);
+#endif
#else
quoted = (name[0] == '"');
if (quoted) {
@@ -1475,12 +1507,19 @@ get_input_file_name (void)
name++;
}
input_file_name = kpse_find_file(name, INPUT_FORMAT, false);
+#ifdef WIN32
+ change_to_long_name (&input_file_name);
+#endif
if (quoted) {
/* Undo modifications */
name[strlen(name)] = '"';
name--;
}
#endif
+#ifdef WIN32
+ if (input_file_name)
+ name = normalize_quotes (input_file_name, "argument");
+#endif
argv[optind] = name;
}
return input_file_name;