summaryrefslogtreecommitdiff
path: root/src/test.c
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2011-12-03 17:49:57 +0100
committerJim Meyering <meyering@redhat.com>2011-12-04 10:31:03 +0100
commit63098ee58235f5a1877220e8c073f6f23b09264f (patch)
treebd2fe30d768fc5cdb499657722e5cdea40664902 /src/test.c
parentbea7b10489afcc845db00b03da6ccea71de6cb1d (diff)
downloadcoreutils-63098ee58235f5a1877220e8c073f6f23b09264f.tar.xz
od,test: address warnings from gcc's -Wjump-misses-init
* src/test.c (unary_operator): gcc reported that initializations in two case statements were skipped. Enclose in braces. * src/od.c (decode_one_format): Likewise.
Diffstat (limited to 'src/test.c')
-rw-r--r--src/test.c32
1 files changed, 18 insertions, 14 deletions
diff --git a/src/test.c b/src/test.c
index 1b06ca86e..a5df7c8dc 100644
--- a/src/test.c
+++ b/src/test.c
@@ -413,22 +413,26 @@ unary_operator (void)
return euidaccess (argv[pos - 1], X_OK) == 0;
case 'O': /* File is owned by you? */
- unary_advance ();
- if (stat (argv[pos - 1], &stat_buf) != 0)
- return false;
- errno = 0;
- uid_t euid = geteuid ();
- uid_t NO_UID = -1;
- return ! (euid == NO_UID && errno) && euid == stat_buf.st_uid;
+ {
+ unary_advance ();
+ if (stat (argv[pos - 1], &stat_buf) != 0)
+ return false;
+ errno = 0;
+ uid_t euid = geteuid ();
+ uid_t NO_UID = -1;
+ return ! (euid == NO_UID && errno) && euid == stat_buf.st_uid;
+ }
case 'G': /* File is owned by your group? */
- unary_advance ();
- if (stat (argv[pos - 1], &stat_buf) != 0)
- return false;
- errno = 0;
- gid_t egid = getegid ();
- gid_t NO_GID = -1;
- return ! (egid == NO_GID && errno) && egid == stat_buf.st_gid;
+ {
+ unary_advance ();
+ if (stat (argv[pos - 1], &stat_buf) != 0)
+ return false;
+ errno = 0;
+ gid_t egid = getegid ();
+ gid_t NO_GID = -1;
+ return ! (egid == NO_GID && errno) && egid == stat_buf.st_gid;
+ }
case 'f': /* File is a file? */
unary_advance ();