[stefan.schuerger: Path problems with trailing dot]

Christopher Faylor me@cgf.cx
Mon May 16 03:52:00 GMT 2005

----- Forwarded message from Stefan Schuerger -----

Today I noticed with streamripper that Cygwin appears to have a problem
with trailing dots in paths:

> mkdir test. ; echo > test./test2
bash: test./test2: No such file or directory

The trailing dot disappears and cannot be used in paths. This seems to
be a DOS legacy of either NTFS or Windows.

Is there anything in the queue to fix this?


Stefan Schuerger

----- End forwarded message -----

Pierre, Corinna,
As the above email illustrates, we are specifically treating a foo.\bar
as invalid in path_conv.  I don't remember the rationale for doing this.
It seems inconsistent to do this given the above example.

The patch below reverts this behavior on non-NT systems but it is
obviously not the right behavior for NT due to the fact that NtCreateFile
doesn't consider "foo." == "foo".  Do either of you remember why
we (i.e., I) did things this way?


Index: path.cc
RCS file: /cvs/uberbaum/winsup/cygwin/path.cc,v
retrieving revision 1.374
diff -u -p -r1.374 path.cc
--- path.cc	13 May 2005 21:05:46 -0000	1.374
+++ path.cc	16 May 2005 03:45:58 -0000
@@ -909,11 +909,13 @@ out:
 	  for (char *p = path; *p; p++)
 	    if (*p != '.' && *p != ' ')
 	      tail = NULL;
+#if 0
 	    else if (p[1] == '\\')
 		error = ENOENT;
 	    else if (!tail)
 	      tail = p;

More information about the Cygwin-developers mailing list