* src/pwck.c: Use a bool when possible instead of int integers.
* src/pwck.c: Ignore return value of setlocale(), bindtextdomain(), and textdomain().
This commit is contained in:
parent
47f937ac13
commit
a31782497c
@ -1,3 +1,9 @@
|
|||||||
|
2008-06-10 Nicolas François <nicolas.francois@centraliens.net>
|
||||||
|
|
||||||
|
* src/pwck.c: Use a bool when possible instead of int integers.
|
||||||
|
* src/pwck.c: Ignore return value of setlocale(),
|
||||||
|
bindtextdomain(), and textdomain().
|
||||||
|
|
||||||
2008-06-10 Nicolas François <nicolas.francois@centraliens.net>
|
2008-06-10 Nicolas François <nicolas.francois@centraliens.net>
|
||||||
|
|
||||||
* src/passwd.c: Use a bool when possible instead of int integers.
|
* src/passwd.c: Use a bool when possible instead of int integers.
|
||||||
|
30
src/pwck.c
30
src/pwck.c
@ -65,16 +65,16 @@
|
|||||||
|
|
||||||
static char *Prog;
|
static char *Prog;
|
||||||
static const char *pwd_file = PASSWD_FILE;
|
static const char *pwd_file = PASSWD_FILE;
|
||||||
static int use_system_pw_file = 1;
|
static bool use_system_pw_file = true;
|
||||||
static const char *spw_file = SHADOW_FILE;
|
static const char *spw_file = SHADOW_FILE;
|
||||||
static int use_system_spw_file = 1;
|
static bool use_system_spw_file = true;
|
||||||
|
|
||||||
static int is_shadow = 0;
|
static bool is_shadow = false;
|
||||||
|
|
||||||
/* Options */
|
/* Options */
|
||||||
static int read_only = 0;
|
static bool read_only = false;
|
||||||
static int sort_mode = 0;
|
static bool sort_mode = false;
|
||||||
static int quiet = 0; /* don't report warnings, only errors */
|
static bool quiet = false; /* don't report warnings, only errors */
|
||||||
|
|
||||||
/* local function prototypes */
|
/* local function prototypes */
|
||||||
static void usage (void);
|
static void usage (void);
|
||||||
@ -110,13 +110,13 @@ static void process_flags (int argc, char **argv)
|
|||||||
switch (arg) {
|
switch (arg) {
|
||||||
case 'e': /* added for Debian shadow-961025-2 compatibility */
|
case 'e': /* added for Debian shadow-961025-2 compatibility */
|
||||||
case 'q':
|
case 'q':
|
||||||
quiet = 1;
|
quiet = true;
|
||||||
break;
|
break;
|
||||||
case 'r':
|
case 'r':
|
||||||
read_only = 1;
|
read_only = true;
|
||||||
break;
|
break;
|
||||||
case 's':
|
case 's':
|
||||||
sort_mode = 1;
|
sort_mode = true;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
usage ();
|
usage ();
|
||||||
@ -142,13 +142,13 @@ static void process_flags (int argc, char **argv)
|
|||||||
if (optind != argc) {
|
if (optind != argc) {
|
||||||
pwd_file = argv[optind];
|
pwd_file = argv[optind];
|
||||||
pw_name (pwd_file);
|
pw_name (pwd_file);
|
||||||
use_system_pw_file = 0;
|
use_system_pw_file = false;
|
||||||
}
|
}
|
||||||
if ((optind + 2) == argc) {
|
if ((optind + 2) == argc) {
|
||||||
spw_file = argv[optind + 1];
|
spw_file = argv[optind + 1];
|
||||||
spw_name (spw_file);
|
spw_name (spw_file);
|
||||||
is_shadow = 1;
|
is_shadow = true;
|
||||||
use_system_spw_file = 0;
|
use_system_spw_file = false;
|
||||||
} else if (optind == argc) {
|
} else if (optind == argc) {
|
||||||
is_shadow = spw_file_present ();
|
is_shadow = spw_file_present ();
|
||||||
}
|
}
|
||||||
@ -609,9 +609,9 @@ int main (int argc, char **argv)
|
|||||||
*/
|
*/
|
||||||
Prog = Basename (argv[0]);
|
Prog = Basename (argv[0]);
|
||||||
|
|
||||||
setlocale (LC_ALL, "");
|
(void) setlocale (LC_ALL, "");
|
||||||
bindtextdomain (PACKAGE, LOCALEDIR);
|
(void) bindtextdomain (PACKAGE, LOCALEDIR);
|
||||||
textdomain (PACKAGE);
|
(void) textdomain (PACKAGE);
|
||||||
|
|
||||||
OPENLOG ("pwck");
|
OPENLOG ("pwck");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user