diff options
author | kib <kib@FreeBSD.org> | 2010-01-24 12:35:36 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2010-01-24 12:35:36 +0000 |
commit | 9fefaa1da5ac95af3adaeb90fa4952d512222d64 (patch) | |
tree | c96ffe7ab80950945f7669f3be0d541f0c85f20d /usr.bin | |
parent | a17ffd5a15a2429e6cad1620e5325e74c383db5d (diff) | |
download | FreeBSD-src-9fefaa1da5ac95af3adaeb90fa4952d512222d64.zip FreeBSD-src-9fefaa1da5ac95af3adaeb90fa4952d512222d64.tar.gz |
Merge scandir(3) interface update to stable/8.
MFC r201512:
Modernize scandir(3) and alphasort(3) interfaces according to the IEEE
Std 1003.1-2008.
MFC r201602:
Move scandir(3) and alphasort(3) into XSI namespace.
MFC r201604:
Use thunks to adapt alphasort-like interface to the comparision function
required by qsort() and qsort_r().
MFC r202556 (by ache):
Use strcoll() in opendir() and alphasort(). Remove some comments.
MFC r202572 (by ache):
Revert to using strcmp() for opendir().
MFC r202677 (by ache):
Style.
MFC r202679 (by ache):
Style: rename internal function to opendir_compar().
MFC r202691 (by ache):
For alphasort(3) add reference to strcoll(3).
MFC r202693 (by ache):
Style: reword comment.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/catman/catman.c | 10 | ||||
-rw-r--r-- | usr.bin/makewhatis/makewhatis.c | 4 |
2 files changed, 10 insertions, 4 deletions
diff --git a/usr.bin/catman/catman.c b/usr.bin/catman/catman.c index ba3ad24..c17a091 100644 --- a/usr.bin/catman/catman.c +++ b/usr.bin/catman/catman.c @@ -589,9 +589,15 @@ process_section(char *mandir, char *section) } static int -select_sections(struct dirent *entry) +select_sections(const struct dirent *entry) { - return directory_type(entry->d_name) == MAN_SECTION_DIR; + char *name; + int ret; + + name = strdup(entry->d_name); + ret = directory_type(name) == MAN_SECTION_DIR; + free(name); + return (ret); } /* diff --git a/usr.bin/makewhatis/makewhatis.c b/usr.bin/makewhatis/makewhatis.c index 6b2dce4..f2ae370 100644 --- a/usr.bin/makewhatis/makewhatis.c +++ b/usr.bin/makewhatis/makewhatis.c @@ -879,9 +879,9 @@ process_section(char *section_dir) * Returns whether the directory entry is a man page section. */ static int -select_sections(struct dirent *entry) +select_sections(const struct dirent *entry) { - char *p = &entry->d_name[3]; + const char *p = &entry->d_name[3]; if (strncmp(entry->d_name, "man", 3) != 0) return 0; |