changeset 16383:497b37552adb

(openp): Omit /: from start of file name.
author Richard M. Stallman <rms@gnu.org>
date Fri, 04 Oct 1996 04:26:09 +0000
parents 509a48e81eaa
children 4ec13b05b0fa
files src/lread.c
diffstat 1 files changed, 16 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/lread.c	Fri Oct 04 01:58:52 1996 +0000
+++ b/src/lread.c	Fri Oct 04 04:26:09 1996 +0000
@@ -635,9 +635,22 @@
 	  char *esuffix = (char *) index (nsuffix, ':');
 	  int lsuffix = esuffix ? esuffix - nsuffix : strlen (nsuffix);
 
-	  /* Concatenate path element/specified name with the suffix.  */
-	  strncpy (fn, XSTRING (filename)->data, XSTRING (filename)->size);
-	  fn[XSTRING (filename)->size] = 0;
+	  /* Concatenate path element/specified name with the suffix.
+	     If the directory starts with /:, remove that.  */
+	  if (XSTRING (filename)->size > 2
+	      && XSTRING (filename)->data[0] == '/'
+	      && XSTRING (filename)->data[1] == ':')
+	    {
+	      strncpy (fn, XSTRING (filename)->data + 2,
+		       XSTRING (filename)->size - 2);
+	      fn[XSTRING (filename)->size - 2] = 0;
+	    }
+	  else
+	    {
+	      strncpy (fn, XSTRING (filename)->data, XSTRING (filename)->size);
+	      fn[XSTRING (filename)->size] = 0;
+	    }
+
 	  if (lsuffix != 0)  /* Bug happens on CCI if lsuffix is 0.  */
 	    strncat (fn, nsuffix, lsuffix);