summaryrefslogtreecommitdiff
path: root/lib/modechange.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2004-07-30 04:05:50 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2004-07-30 04:05:50 +0000
commitf9663b8c838db9524c5fac5cfd4689b59c1bfc5d (patch)
tree2c3dea7d3ea6fe3c006780451224b2a80f0a87d6 /lib/modechange.c
parent0d812118fa0757bcffca6e68ade86cc57dd53281 (diff)
downloadcoreutils-f9663b8c838db9524c5fac5cfd4689b59c1bfc5d.tar.xz
Include <stdbool.h>.
(mode_compile): Use bool when appropriate.
Diffstat (limited to 'lib/modechange.c')
-rw-r--r--lib/modechange.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/modechange.c b/lib/modechange.c
index c9bdbe7bd..53926b811 100644
--- a/lib/modechange.c
+++ b/lib/modechange.c
@@ -33,6 +33,7 @@
#include "modechange.h"
#include <sys/stat.h>
#include "xstrtol.h"
+#include <stdbool.h>
#include <stddef.h>
#include <stdlib.h>
@@ -220,12 +221,10 @@ mode_compile (const char *mode_string, unsigned int masked_ops)
/* `affected_bits' modified by umask. */
mode_t affected_masked;
/* Operators to actually use umask on. */
- unsigned ops_to_mask = 0;
+ unsigned int ops_to_mask = 0;
- int who_specified_p;
+ bool who_specified_p;
- affected_bits = 0;
- ops_to_mask = 0;
/* Turn on all the bits in `affected_bits' for each group given. */
for (++mode_string;; ++mode_string)
switch (*mode_string)
@@ -250,10 +249,10 @@ mode_compile (const char *mode_string, unsigned int masked_ops)
/* If none specified, affect all bits, except perhaps those
set in the umask. */
if (affected_bits)
- who_specified_p = 1;
+ who_specified_p = true;
else
{
- who_specified_p = 0;
+ who_specified_p = false;
affected_bits = CHMOD_MODE_BITS;
ops_to_mask = masked_ops;
}