svn commit: r319131 - stable/10/lib/libc/stdlib
Konstantin Belousov
kib at FreeBSD.org
Mon May 29 13:00:40 UTC 2017
Author: kib
Date: Mon May 29 13:00:39 2017
New Revision: 319131
URL: https://svnweb.freebsd.org/changeset/base/319131
Log:
MFC r318303:
Style.
Modified:
stable/10/lib/libc/stdlib/realpath.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/lib/libc/stdlib/realpath.c
==============================================================================
--- stable/10/lib/libc/stdlib/realpath.c Mon May 29 12:59:24 2017 (r319130)
+++ stable/10/lib/libc/stdlib/realpath.c Mon May 29 13:00:39 2017 (r319131)
@@ -89,7 +89,7 @@ realpath1(const char *path, char *resolv
*/
p = strchr(left, '/');
- next_token_len = p ? p - left : left_len;
+ next_token_len = p != NULL ? p - left : left_len;
memcpy(next_token, left, next_token_len);
next_token[next_token_len] = '\0';
@@ -112,10 +112,9 @@ realpath1(const char *path, char *resolv
if (next_token[0] == '\0') {
/* Handle consequential slashes. */
continue;
- }
- else if (strcmp(next_token, ".") == 0)
+ } else if (strcmp(next_token, ".") == 0) {
continue;
- else if (strcmp(next_token, "..") == 0) {
+ } else if (strcmp(next_token, "..") == 0) {
/*
* Strip the last path component except when we have
* single "/"
@@ -146,13 +145,12 @@ realpath1(const char *path, char *resolv
}
slen = readlink(resolved, symlink, sizeof(symlink));
if (slen <= 0 || slen >= sizeof(symlink)) {
- if (slen < 0) {
- /* keep errno from readlink(2) call */
- } else if (slen == 0) {
+ if (slen < 0)
+ ; /* keep errno from readlink(2) call */
+ else if (slen == 0)
errno = ENOENT;
- } else {
+ else
errno = ENAMETOOLONG;
- }
return (NULL);
}
symlink[slen] = '\0';
More information about the svn-src-all
mailing list