No empty .Rs/.Re
[netbsd-mini2440.git] / share / man / tools / noso.c
blob7f1599756ebdf78bee11c1470be58eef47c6b28c
1 /* $NetBSD$ */
3 #include <stdio.h>
4 #include <sys/types.h>
5 #include <sys/stat.h>
6 #include <sys/file.h>
8 main(argc, argv)
9 char *argv[];
11 struct stat sb;
12 register char *cp;
13 int i, fd, count = 0;
14 char buf[10];
16 for (cp = "", i = 1; i < argc; cp = " ", i++) {
17 if (lstat(argv[i], &sb) < 0)
18 continue;
19 if (!S_ISREG(sb.st_mode))
20 continue;
21 fd = open(argv[i], O_RDONLY);
22 if (fd < 0) {
23 perror(argv[i]);
24 continue;
26 if (read(fd, buf, 3) != 3) {
27 close(fd);
28 continue;
30 if (strncmp(buf, ".so", 3))
31 count++, printf("%s%s", cp, argv[i]);
32 close(fd);
34 if (count > 0)
35 putchar('\n');