summaryrefslogtreecommitdiff
path: root/lib/modechange.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2004-08-07 00:09:38 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2004-08-07 00:09:38 +0000
commita62be9f4039b4499cfbb76e394cad2259d03fa84 (patch)
tree5f444ac72b8b2418f2530af42b6c2fee823d18db /lib/modechange.c
parent4d52451995952d65b6772a7849e88866b3542157 (diff)
downloadgnulib-a62be9f4039b4499cfbb76e394cad2259d03fa84.tar.gz
Merge from coreutils.
Diffstat (limited to 'lib/modechange.c')
-rw-r--r--lib/modechange.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/modechange.c b/lib/modechange.c
index c9bdbe7bdb..b4df3388ce 100644
--- a/lib/modechange.c
+++ b/lib/modechange.c
@@ -1,7 +1,7 @@
/* modechange.c -- file mode manipulation
- Copyright (C) 1989, 1990, 1997, 1998, 1999, 2001, 2003 Free Software
- Foundation, Inc.
+ Copyright (C) 1989, 1990, 1997, 1998, 1999, 2001, 2003, 2004 Free
+ Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -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;
}