On Tue, 28 Jun 2022 09:44:56 +0200 Timothee Besset wrote: > We are seeing some odd behavior from cygpath.exe when it is copied and used > outside the normal cygwin installation directory: > > PS C:\Users\ttimo> C:\cygwin64\bin\cygpath.exe -a -u "C:" > /cygdrive/c > > After copying cygpath.exe and cygwin1.dll to a blank C:\tmp: > > PS C:\Users\ttimo> C:\tmp\cygpath.exe -a -u "C:" > / > > (should be /cygdrive/c!)
Both / and /cygdrive/c are correct in this case. The root directory for cygwin is the parent directory of the directory where cygwin1.dll is located. If cygwin1.dll is located in c:\tmp, the root directory for cygwin is c:\. Therefore, / is correct answer for cygpath -u 'c:\'. This is the same with the fact that c:\cygwin64\bin\cygpath.exe -u "c:\cygwin64" returns / rather than /cygdrive/c/cygwin64. > After copying those same files to C:\tmp\tmp: > > PS C:\Users\ttimo> C:\tmp\tmp\cygpath.exe -a -u "C:" > /cygdrive/c In this case, the root directory for cygwin is c:\tmp. Therefore, c:\ is outside of the cygwin directories. So, cygpath -u 'c:\' returns /cygdrive/c. -- Takashi Yano <takashi.y...@nifty.ne.jp> -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple