[tex-live] Fwd: Re: Error TL12 kpsewhich in ifxetex

Norbert Preining preining at logic.at
Tue Jun 26 07:02:26 CEST 2012


On Di, 26 Jun 2012, Norbert Preining wrote:
> the "b" was introduced by Peter in svn 23549
> r23549 | peter | 2011-08-14 23:23:26 +0900 (日, 14  8月 2011) | 1 line
> 
> upTeX and e-upTeX (preliminary)
> 
> 
> where "r" -> "rb"
> and "w" -> "wb"

It seems that the "b" for open in binary mode is not supported on
Unix, but only for the _popen call of Windows, at least what I found
on MSDN.

That means we have to do something like that, no guarantee:
Index: texmfmp.c
===================================================================
--- texmfmp.c	(revision 26897)
+++ texmfmp.c	(working copy)
@@ -533,7 +533,11 @@
   char *cmdname = NULL;
   int allow;
 
+  string realmode = xmalloc(strlen(mode)+2);
+  strcpy(realmode, mode);
 #ifdef WIN32
+  strcat(realmode, "b");
+
   char *pp;
 
   for (pp = cmd; *pp; pp++) {
@@ -548,9 +552,9 @@
     allow = shell_cmd_is_allowed (cmd, &safecmd, &cmdname);
 
   if (allow == 1)
-    f = popen (cmd, mode);
+    f = popen (cmd, realmode);
   else if (allow == 2)
-    f = popen (safecmd, mode);
+    f = popen (safecmd, realmode);
   else if (allow == -1)
     fprintf (stderr, "\nrunpopen quotation error in command line: %s\n",
              cmd);
@@ -561,6 +565,7 @@
     free (safecmd);
   if (cmdname)
     free (cmdname);
+  free (realmode);
   return f;
 }
 #endif /* ENABLE_PIPES */
@@ -1853,7 +1858,7 @@
       fname = xmalloc(strlen((const_string)(nameoffile+1))+1);
       strcpy(fname,(const_string)(nameoffile+1));
       recorder_record_input (fname + 1);
-      *f_ptr = runpopen(fname+1,"rb");
+      *f_ptr = runpopen(fname+1,"r");
       free(fname);
       for (i=0; i<NUM_PIPES; i++) {
         if (pipes[i]==NULL) {
@@ -1895,10 +1900,10 @@
            is better to be prepared */
         if (STREQ((fname+strlen(fname)-4),".tex"))
           *(fname+strlen(fname)-4) = 0;
-        *f_ptr = runpopen(fname+1,"wb");
+        *f_ptr = runpopen(fname+1,"w");
         *(fname+strlen(fname)) = '.';
       } else {
-        *f_ptr = runpopen(fname+1,"wb");
+        *f_ptr = runpopen(fname+1,"w");
       }
       recorder_record_output (fname + 1);
       free(fname);

Best wishes

Norbert
------------------------------------------------------------------------
Norbert Preining            preining@{jaist.ac.jp, logic.at, debian.org}
JAIST, Japan                                 TeX Live & Debian Developer
DSA: 0x09C5B094   fp: 14DF 2E6C 0307 BE6D AD76  A9C0 D2BF 4AA3 09C5 B094
------------------------------------------------------------------------
ACLE (n.)
The rouge pin which shirtmakers conceal in the most improbable fold of
a new shirt. Its function is to stab you when you don the garment.
			--- Douglas Adams, The Meaning of Liff


More information about the tex-live mailing list