Subject: cygpath bug in version 1.25
From: "Newton, Doug" <[email-masked]>
To: "[email-masked]'" <[email-masked]>
Cc: "[email-masked]'" <[email-masked]>
Date: Mon, 10 Feb 2003 17:29:32 -0600

I believe I have found a bug in cygpath.exe version 1.25 (Which has been the
version included since at least cygwin version 1.3.17-1 and through cygwin
version 1.3.20-1).

Using installations from any release since 1.3.17-1 (the earliest full
installation that I had available), cygpath does work fine if converting a
dos classpath to a unix classpath, and converting a unix classpath to a dos
classpath.  BUT, if you try to convert a long unix classpath to a unix
classpath, I have had truncation occur.  The following example was run with
cygwin version 1.3.17-1:

$ echo $CLASSPATH
/home/dnewton/dev/nextgen_src/build:/usr/software/lib/endorsed/xml-apis.jar:
/usr/software/lib/endorsed/xercesImpl.jar:/usr/software/lib/endorsed/xalan.j
ar:/usr/software/lib/bcel.jar:/usr/software/lib/bsf.jar:/usr/software/lib/js
.jar:/usr/software/lib/jakarta-oro-2.0.2.jar:/usr/software/lib/ojdbc14.jar:/
usr/software/lib/log4j-1.2.7.jar:/usr/software/lib/logkit.jar:/usr/software/
lib/maybeupload.jar:/usr/software/lib/junit.jar:/usr/software/lib/jdom.jar:/
usr/software/lib/ecs-1.4.1.jar:/usr/software/lib/avalonapi.jar:/usr/software
/lib/jakarta-regexp-1.2.jar:/usr/software/lib/jstyle.jar:/usr/software/lib/f
op-0_17_0.jar:/usr/software/lib/saxpath.jar:/usr/software/lib/jaxen-full.jar
:/usr/software/lib/antlr-all.jar:/usr/software/lib/servlet.jar:/usr/software
/lib/struts.jar:/usr/software/lib/getopt.jar:/usr/software/lib/gnu-regexp.ja
r:/usr/software/lib/jacorb.jar:/usr/software/lib/jboss-client.jar:/usr/softw
are/lib/jboss-common-client.jar:/usr/software/lib/jbossha-client.jar:/usr/so
ftware/lib/jboss-iiop-client.jar:/usr/software/lib/jboss-j2ee.jar:/usr/softw
are/lib/jboss-jaas.jar:/usr/software/lib/jbossjmx-ant.jar:/usr/software/lib/
jboss-jsr77-client.jar:/usr/software/lib/jbossmq-client.jar:/usr/software/li
b/jbossmqha.jar:/usr/software/lib/jboss-net-client.jar:/usr/software/lib/jbo
sssx-client.jar:/usr/software/lib/jboss-system-client.jar:/usr/software/lib/
jboss-transaction-client.jar:/usr/software/lib/jmx-connector-client-factory.
jar:/usr/software/lib/jmx-ejb-connector-client.jar:/usr/software/lib/jmx-rmi
-connector-client.jar:/usr/software/lib/jnp-client.jar:/usr/software/lib/con
current.jar:/usr/software/antExtensions/lib/checkstyle-2.4.jar

$ cygpath --path --unix $CLASSPATH
/home/dnewton/dev/nextgen_src/build:/usr/software/lib/endorsed/xml-apis.jar:
/usr/software/lib/endorsed/xercesImpl.jar:/usr/software/lib/endorsed/xalan.j
ar:/usr/software/lib/bcel.jar:/usr/software/lib/bsf.jar:/usr/software/lib/js
.jar:/usr/software/lib/jakarta-

This same behaviour with this test case exists through cygwin version
1.3.20-1.

I attempted to use an older version of the cygpath.exe (1.21) and the
problem did not occur.  (I didn't have an installation that included cygpath
1.21, so I took the cygpath.exe from a machine that had an older cygwin
installed, and replaced the cygpath.exe in my install with the old one.
Since cygpath.exe 1.21 worked running against the same cygwin1.dll, it would
seem that the bug is in the cygpath code.

(If you ask why I would convert unix to unix:   Our build environment always
uses unix format classpaths, but the current version of ant will always run
a "cygpath --path --unix $CLASSPATH" in its execution to insure it knows the
format when on a cygwin platform).

Has anyone else seen this problem, or is it known and due to be fixed?  I
looked at the cygpath.cc code in the in the online CVS history, and saw that
major changes occurred between cygpath 1.24 and 1.25, including removal of a
block of code that exits the function when no change is needed.  I'm not a
cygwin developer, but that looked at least a bit suspicious.

If you wouldn't mind, please copy any replies to [email-masked], as I am
not a subscriber.

Thanks in advance for any help.

--Doug Newton
[email-masked]

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/