On Sat, Apr 15, 2006 at 06:54:56PM +0200, Georg Baum wrote:

> Am Samstag, 15. April 2006 18:21 schrieb Enrico Forestieri:
> > Very unlikely failure on windows, very unlikely failure on unix, but
> > certain failure with cygwin. It seems to me that you don't care for 
> cygwin.
> 
> I care far too much given that I don't use it.

First of all I would like to make it clear that I feel obliged
to you as you have to spend time for bearing with me.
As a second thing, I apologize for myself because rereading my
post I understand that it may have sounded rude, and was not intended.
As a last thing, come on Georg, I don't care for native Windows either,
but if something should be corrected I think that it is to be done.

> If this is a certain 
> failure on cygwin, why don't you test for the presence of a cygwin 
> specific environment variable? Then it would work in all cases.

I can't do that because it doesn't depend on cygwin or windows but
on miktex or tetex. If you use miktex SEP=';', if you use tetex SEP=':'.
I am attaching a revised patch taking into account your previous
counterexample, which now works.

Then I promise to disappear under a stone (to cite someone else).

> > Frankly, the example with the escaped ';', which is a command separator
> > in every unix shell I know, is a bit ridiculous.
> 
> People are doing ridiculous things.

You are very right, but please admit that a ';' in a filename occurs
with a lower probability than a space in unix...

-- 
Enrico
Index: lib/scripts/TeXFiles.sh
===================================================================
--- lib/scripts/TeXFiles.sh     (revision 13686)
+++ lib/scripts/TeXFiles.sh     (working copy)
@@ -42,14 +42,17 @@ test -z "$types" && types="cls sty bst b
 
 #
 # MS-DOS and MS-Windows define $COMSPEC or $ComSpec and use ';' to separate
-# directories in path lists whereas Unixes uses ':'.
+# directories in path lists whereas Unixes uses ':'. However, on MS-Windows
+# we should also take into account Cygwin, which uses ':'. So, instead of
+# guessing based on $COMSPEC, we try to directly determine the path separator.
 # $SEP holds the right character to be used by the scripts.
 #
-#???????????????
-# never used this one with windows and what happens with mac??
-#???????????????
-#
-if test -z "$COMSPEC" && test -z "$ComSpec"; then SEP=':'; else SEP=';'; fi
+if test -z "$COMSPEC" && test -z "$ComSpec"; then
+    SEP=':'
+else
+    SEP=`kpsewhich --show-path=.tex 2>/dev/null | sed 's/.*\(;\).*/\1/'`
+    if test "$SEP" != ";"; then SEP=':'; fi
+fi
 
 #
 # A copy of some stuff from mktex.opt, so we can run in the presence of

Reply via email to