SCCS-vsn: bin/csh/dir.c 5.18
-static char sccsid[] = "@(#)dir.c 5.17 (Berkeley) %G%";
+static char sccsid[] = "@(#)dir.c 5.18 (Berkeley) %G%";
#endif /* not lint */
#include <sys/param.h>
#endif /* not lint */
#include <sys/param.h>
(void) fprintf(cshout, "%d\t", idx++);
cur = 0;
}
(void) fprintf(cshout, "%d\t", idx++);
cur = 0;
}
if (!(dirflag & DIR_LONG) && hp != NULL && !eq(hp, STRslash) &&
if (!(dirflag & DIR_LONG) && hp != NULL && !eq(hp, STRslash) &&
- prefix(hp, dp->di_name))
- len = Strlen(s = (dp->di_name + Strlen(hp))) + 2;
+ Strncmp(hp, dp->di_name, len) == 0 &&
+ (dp->di_name[len] == '\0' || dp->di_name[len] == '/'))
+ len = Strlen(s = (dp->di_name + len)) + 2;
else
len = Strlen(s = dp->di_name) + 1;
else
len = Strlen(s = dp->di_name) + 1;