comparison src/lread.c @ 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 b91af71f45f1
children 8e154ff6d4bf
comparison
equal deleted inserted replaced
16382:509a48e81eaa 16383:497b37552adb
633 while (1) 633 while (1)
634 { 634 {
635 char *esuffix = (char *) index (nsuffix, ':'); 635 char *esuffix = (char *) index (nsuffix, ':');
636 int lsuffix = esuffix ? esuffix - nsuffix : strlen (nsuffix); 636 int lsuffix = esuffix ? esuffix - nsuffix : strlen (nsuffix);
637 637
638 /* Concatenate path element/specified name with the suffix. */ 638 /* Concatenate path element/specified name with the suffix.
639 strncpy (fn, XSTRING (filename)->data, XSTRING (filename)->size); 639 If the directory starts with /:, remove that. */
640 fn[XSTRING (filename)->size] = 0; 640 if (XSTRING (filename)->size > 2
641 && XSTRING (filename)->data[0] == '/'
642 && XSTRING (filename)->data[1] == ':')
643 {
644 strncpy (fn, XSTRING (filename)->data + 2,
645 XSTRING (filename)->size - 2);
646 fn[XSTRING (filename)->size - 2] = 0;
647 }
648 else
649 {
650 strncpy (fn, XSTRING (filename)->data, XSTRING (filename)->size);
651 fn[XSTRING (filename)->size] = 0;
652 }
653
641 if (lsuffix != 0) /* Bug happens on CCI if lsuffix is 0. */ 654 if (lsuffix != 0) /* Bug happens on CCI if lsuffix is 0. */
642 strncat (fn, nsuffix, lsuffix); 655 strncat (fn, nsuffix, lsuffix);
643 656
644 /* Ignore file if it's a directory. */ 657 /* Ignore file if it's a directory. */
645 if (stat (fn, &st) >= 0 658 if (stat (fn, &st) >= 0