projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
BSD 4_3 release
[unix-history]
/
usr
/
src
/
usr.bin
/
find
/
find.c
diff --git
a/usr/src/usr.bin/find/find.c
b/usr/src/usr.bin/find/find.c
index
a3c9b02
..
e948647
100644
(file)
--- a/
usr/src/usr.bin/find/find.c
+++ b/
usr/src/usr.bin/find/find.c
@@
-1,5
+1,5
@@
#ifndef lint
#ifndef lint
-static char *sccsid = "@(#)find.c 4.1
3 (Berkeley) %G%
";
+static char *sccsid = "@(#)find.c 4.1
7 (Berkeley) 1/31/86
";
#endif
#include <stdio.h>
#endif
#include <stdio.h>
@@
-201,7
+201,8
@@
struct anode *e3() { /* parse parens and predicates */
nouser(), nogroup(), ls(), dummy();
struct anode *p1;
int i;
nouser(), nogroup(), ls(), dummy();
struct anode *p1;
int i;
- register char *a, *b, s;
+ register char *a, *b;
+ register int s;
a = nxtarg();
if(EQ(a, "(")) {
a = nxtarg();
if(EQ(a, "(")) {
@@
-713,7
+714,8
@@
register char *s, *p;
return(0);
case '-':
return(0);
case '-':
- k |= lc <= scc && scc <= (cc=p[1]);
+ cc = p[1];
+ k |= lc <= scc && scc <= cc;
}
if (scc==(lc=cc)) k++;
}
}
if (scc==(lc=cc)) k++;
}
@@
-962,13
+964,11
@@
getname(uid)
register struct passwd *pw;
struct passwd *getpwent();
register int cp;
register struct passwd *pw;
struct passwd *getpwent();
register int cp;
-#ifndef NO_PW_STAYOPEN
extern int _pw_stayopen;
_pw_stayopen = 1;
extern int _pw_stayopen;
_pw_stayopen = 1;
-#endif
-#if ((
NUID) & ((NUID) - 1
) != 0)
+#if ((
(NUID) & ((NUID) - 1)
) != 0)
cp = uid % (NUID);
#else
cp = uid & ((NUID) - 1);
cp = uid % (NUID);
#else
cp = uid & ((NUID) - 1);
@@
-1163,9
+1163,20
@@
list(file, stp)
sprintf(fsize, "%8ld", stp->st_size);
#ifdef S_IFLNK
if (pmode[0] == 'l') {
sprintf(fsize, "%8ld", stp->st_size);
#ifdef S_IFLNK
if (pmode[0] == 'l') {
- who = readlink(file, flink, sizeof flink - 1);
+ /*
+ * Need to get the tail of the file name, since we have
+ * already chdir()ed into the directory of the file
+ */
+ cp = rindex(file, '/');
+ if (cp == NULL)
+ cp = file;
+ else
+ cp++;
+ who = readlink(cp, flink, sizeof flink - 1);
if (who >= 0)
flink[who] = '\0';
if (who >= 0)
flink[who] = '\0';
+ else
+ flink[0] = '\0';
}
#endif
}
}
#endif
}