[comp.emacs] VMS GNU Bug - file_name_as_directory

mike@yetti.UUCP (Mike Clarkson ) (06/23/87)

[.SRC]FILEIO.C Bug 
file-name-as-directory does not know about versions -

(file-name-as-directory "old.dir")
"[.old]"	; right

but
(file-name-as-directory "old.dir;1")
"old.dir;1/"	; wrong

At line 167 of $emacs/src/fileio.c

  /* Is it a VMS directory file name?  If so, hack VMS syntax.  */
  else if (! index (in, '/')
	   && ((size > 3 && ! strcmp (&in[size - 3], ".dir"))
	       || (size > 5 && ! strcmp (&in[size - 5], ".dir.1"))))
    {

That's nice but what about ".dir;" and ".dir;1" (and maybe even ".dir.")?
Obviously the if statement should read

  /* Is it a VMS directory file name?  If so, hack VMS syntax.  */
  else if (! index (in, '/')
	   && ((size > 3 && ! strcmp (&in[size - 3], ".dir"))
	       || (size > 5 && ! strcmp (&in[size - 5], ".dir;1"))
	       || (size > 4 && ! strcmp (&in[size - 4], ".dir;"))
	       || (size > 5 && ! strcmp (&in[size - 5], ".dir.1"))))
    {

but the question is, will anything else break in the body of the if code ?

I am also wondering if the code

#endif /* VMS */
  /* For Unix syntax, Append a slash if necessary */
  if (out[size] != '/')
    strcat (out, "/");

should be changed to

#else
  /* For Unix syntax, Append a slash if necessary */
  if (out[size] != '/')
    strcat (out, "/");
#endif /* VMS */

I can't imagine that anything in VMS would rely on a directory
name ending in a slash.  And if it does, it shouldn't.

(VMS GNU Emacs version 18.44 under VMS 4.5)


-- 
Mike Clarkson,		  ...!allegra \			BITNET:	mike@YUYETTI or
CRESS, York University,	  ...!decvax   \			SYMALG@YUSOL
4700 Keele Street,	  ...!ihnp4     > !utzoo!yetti!mike
North York, Ontario,	  ...!linus    /		     
CANADA M3J 1P3.		  ...!watmath /		Phone: +1 (416) 736-2100 x 7767


"...the most inevitable business communications system on the planet."
						- ROLM magazine advertisement
 which planet?