[tex-k] Strange first line parsing

Alexander Cherepanov cherepan at mccme.ru
Sun Nov 22 15:39:13 CET 2009


Hi!

Parsing first line of tex files works somewhat strange. The following 
first line:

%& a b c d e

leads to loading `d e.tcx'. The fix is trivial:

diff -ur web2c.orig/lib/texmfmp.c web2c/lib/texmfmp.c
--- web2c.orig/lib/texmfmp.c	2009-11-12 12:54:24.000000000 +0300
+++ web2c/lib/texmfmp.c	2009-11-22 17:22:20.000000000 +0300
@@ -1642,6 +1642,7 @@
       /* The tcx stuff, if any.  Should we support the -translate-file
          form as well as --translate-file?  */
       if (*parse) {
+        s = NULL;
         if (translate_filename) {
           /* TCX file already set, do nothing. */
         } else if (STREQ (*parse, "--translate-file")) {

And a couple of typos:

diff -ur kpathsea.orig/BUGS kpathsea/BUGS
--- kpathsea.orig/BUGS	2006-01-18 00:41:51.000000000 +0300
+++ kpathsea/BUGS	2009-11-22 17:29:19.000000000 +0300
@@ -441,7 +441,7 @@
 the pointer to the allocated memory, subtract the lower index, and use
 the resulting pointer for the array.  While this trick often works, ANSI
 C doesn't guarantee that it will.  It it known to fail on HP-UX 10
-mchines when the native compiler is used, unless the `+u' compiler
+machines when the native compiler is used, unless the `+u' compiler
 switch was specified.  Using GCC will work on this platform as well.
 
 0.1.5.5 Empty Makefiles

diff -ur web2c.orig/lib/usage.c web2c/lib/usage.c
--- web2c.orig/lib/usage.c	2009-06-24 11:02:11.000000000 +0400
+++ web2c/lib/usage.c	2009-11-22 17:26:05.000000000 +0300
@@ -16,7 +16,7 @@
 }
 
 /* Call usage if the program exits by printing the help message.
-   MESSAGE is an NULL-terminated array or strings which make up the
+   MESSAGE is an NULL-terminated array of strings which make up the
    help message.  Each string is printed on a separate line.
    We use arrays instead of a single string to work around compiler
    limitations (sigh).

Alexander Cherepanov




More information about the tex-k mailing list