Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 May 2017 13:00:39 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r319131 - stable/10/lib/libc/stdlib
Message-ID:  <201705291300.v4TD0drD093857@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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';



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201705291300.v4TD0drD093857>