diff options
author | Jim Meyering <jim@meyering.net> | 2003-03-05 10:45:38 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2003-03-05 10:45:38 +0000 |
commit | 9bd9db554ac969c922d92b2572d5b6c2ebe3f9c5 (patch) | |
tree | d002d35cfb2b8ad683980955f579363f75ca29e9 | |
parent | 4e8dbeb9345cbfd625fa7b1a6f8b4b5075d0794d (diff) | |
download | coreutils-9bd9db554ac969c922d92b2572d5b6c2ebe3f9c5.tar.xz |
fix logic error
-rw-r--r-- | m4/getcwd-path-max.m4 | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/m4/getcwd-path-max.m4 b/m4/getcwd-path-max.m4 index c64fbe9e4..3430888f5 100644 --- a/m4/getcwd-path-max.m4 +++ b/m4/getcwd-path-max.m4 @@ -82,10 +82,14 @@ main () cwd_len += 1 + strlen (DIR_NAME); /* If mkdir or chdir fails, be pessimistic and consider that as a failure, too. */ - if (mkdir (DIR_NAME, 0700) < 0 - || chdir (DIR_NAME) < 0 - || ((c = getcwd (buf, PATH_MAX)) != NULL - && (len = strlen (c)) != cwd_len)) + if (mkdir (DIR_NAME, 0700) < 0 || chdir (DIR_NAME) < 0) + { + fail = 1; + break; + } + if ((c = getcwd (buf, PATH_MAX)) == NULL) + break; + if ((len = strlen (c)) != cwd_len) { fail = 1; break; |