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
kernel tracing
[unix-history]
/
usr
/
src
/
usr.bin
/
uucp
/
gnamef.c
diff --git
a/usr/src/usr.bin/uucp/gnamef.c
b/usr/src/usr.bin/uucp/gnamef.c
index
8319409
..
5ac1e4d
100644
(file)
--- a/
usr/src/usr.bin/uucp/gnamef.c
+++ b/
usr/src/usr.bin/uucp/gnamef.c
@@
-1,19
+1,18
@@
#ifndef lint
#ifndef lint
-static char sccsid[] = "@(#)gnamef.c 5.
2
(Berkeley) %G%";
+static char sccsid[] = "@(#)gnamef.c 5.
4
(Berkeley) %G%";
#endif
#include "uucp.h"
#endif
#include "uucp.h"
-#include <sys/types.h>
#ifdef NDIR
#include "ndir.h"
#else
#include <sys/dir.h>
#endif
#ifdef NDIR
#include "ndir.h"
#else
#include <sys/dir.h>
#endif
-/*
******
- * gnamef(dirp, filename) get next file name from directory
- * DIR *dirp;
- *
char *filename;
+/*
LINTLIBRARY*/
+
+/*
+ *
get next file name from directory
*
* return codes:
* 0 - end of directory read
*
* return codes:
* 0 - end of directory read
@@
-26,15
+25,17
@@
register char *filename;
{
register struct direct *dentp;
{
register struct direct *dentp;
- while (1) {
- if ((dentp = readdir(dirp)) == NULL)
- return(0);
+ for (;;) {
+ if ((dentp = readdir(dirp)) == NULL) {
+ return 0;
+ }
if (dentp->d_ino != 0)
break;
}
if (dentp->d_ino != 0)
break;
}
- /* Truncate filename. This may become a problem someday.
rti!trt
*/
+ /* Truncate filename. This may become a problem someday. */
strncpy(filename, dentp->d_name, NAMESIZE-1);
filename[NAMESIZE-1] = '\0';
strncpy(filename, dentp->d_name, NAMESIZE-1);
filename[NAMESIZE-1] = '\0';
- return(1);
+ DEBUG(99,"gnamef returns %s\n",filename);
+ return 1;
}
}