And get rid of stdbool.h true/false usage.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
#include <errno.h>
#include <getopt.h>
#include <pwd.h>
-#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
static int get_shell_list(const char *shell_name)
{
FILE *fp;
- int found;
+ int found = 0;
char *buf = NULL;
size_t sz = 0, len;
- found = false;
fp = fopen(_PATH_SHELLS, "r");
if (!fp) {
if (!shell_name)
warnx(_("No known shells."));
- return true;
+ return 0;
}
while (getline(&buf, &sz, fp) != -1) {
len = strlen(buf);
/* check or output the shell */
if (shell_name) {
if (!strcmp(shell_name, buf)) {
- found = true;
+ found = 1;
break;
}
} else