memcpy (tmp - 1, gconv_module_ext, sizeof (gconv_module_ext));
if (__tfind (new_module, modules, module_compare) == NULL)
- if (__tsearch (new_module, modules, module_compare) == NULL)
- /* Something went wrong while inserting the new module. */
- free (new_module);
- else
- ++*nmodules;
+ {
+ if (__tsearch (new_module, modules, module_compare) == NULL)
+ /* Something went wrong while inserting the new module. */
+ free (new_module);
+ else
+ ++*nmodules;
+ }
}
}
/* Let's see whether we have these coded character sets. */
cd = iconv_open (to_code, from_code);
if (cd == (iconv_t) -1)
- if (errno == EINVAL)
- error (EXIT_FAILURE, 0, _("conversion from `%s' to `%s' not supported"),
- from_code, to_code);
- else
- error (EXIT_FAILURE, errno, _("failed to start conversion processing"));
+ {
+ if (errno == EINVAL)
+ error (EXIT_FAILURE, 0, _("conversion from `%s' to `%s' not supported"),
+ from_code, to_code);
+ else
+ error (EXIT_FAILURE, errno, _("failed to start conversion processing"));
+ }
/* Determine output file. */
if (output_file != NULL)
if (instr == FTS_FOLLOW &&
(p->fts_info == FTS_SL || p->fts_info == FTS_SLNONE)) {
p->fts_info = fts_stat(sp, NULL, p, 1);
- if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR))
+ if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR)) {
if ((p->fts_symfd = __open(".", O_RDONLY, 0)) < 0) {
p->fts_errno = errno;
p->fts_info = FTS_ERR;
} else
p->fts_flags |= FTS_SYMFOLLOW;
+ }
return (p);
}
goto next;
if (p->fts_instr == FTS_FOLLOW) {
p->fts_info = fts_stat(sp, NULL, p, 1);
- if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR))
+ if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR)) {
if ((p->fts_symfd =
__open(".", O_RDONLY, 0)) < 0) {
p->fts_errno = errno;
p->fts_info = FTS_ERR;
} else
p->fts_flags |= FTS_SYMFOLLOW;
+ }
p->fts_instr = FTS_NOINSTR;
}
* checking FTS_NS on the returned nodes.
*/
cderrno = 0;
- if (nlinks || type == BREAD)
+ if (nlinks || type == BREAD) {
if (FCHDIR(sp, dirfd(dirp))) {
if (nlinks && type == BREAD)
cur->fts_errno = errno;
cderrno = errno;
} else
descend = 1;
- else
+ } else
descend = 0;
/*
/* Get stat info for start directory. */
if (result == 0)
- if (((flags & FTW_PHYS)
- ? LXSTAT (_STAT_VER, data.dirbuf, &st)
- : XSTAT (_STAT_VER, data.dirbuf, &st)) < 0)
- {
- if (errno == EACCES)
- result = (*data.func) (data.dirbuf, &st, FTW_NS, &data.ftw);
- else if (!(flags & FTW_PHYS)
- && errno == ENOENT
- && LXSTAT (_STAT_VER, dir, &st) == 0
- && S_ISLNK (st.st_mode))
- result = (*data.func) (data.dirbuf, &st, data.cvt_arr[FTW_SLN],
- &data.ftw);
- else
- /* No need to call the callback since we cannot say anything
- about the object. */
- result = -1;
- }
- else
- {
- if (S_ISDIR (st.st_mode))
- {
- /* Remember the device of the initial directory in case
- FTW_MOUNT is given. */
- data.dev = st.st_dev;
-
- /* We know this directory now. */
- if (!(flags & FTW_PHYS))
- result = add_object (&data, &st);
-
- if (result == 0)
- result = ftw_dir (&data, &st);
- }
- else
- {
- int flag = S_ISLNK (st.st_mode) ? FTW_SL : FTW_F;
-
- result = (*data.func) (data.dirbuf, &st, data.cvt_arr[flag],
+ {
+ if (((flags & FTW_PHYS)
+ ? LXSTAT (_STAT_VER, data.dirbuf, &st)
+ : XSTAT (_STAT_VER, data.dirbuf, &st)) < 0)
+ {
+ if (errno == EACCES)
+ result = (*data.func) (data.dirbuf, &st, FTW_NS, &data.ftw);
+ else if (!(flags & FTW_PHYS)
+ && errno == ENOENT
+ && LXSTAT (_STAT_VER, dir, &st) == 0
+ && S_ISLNK (st.st_mode))
+ result = (*data.func) (data.dirbuf, &st, data.cvt_arr[FTW_SLN],
&data.ftw);
- }
- }
+ else
+ /* No need to call the callback since we cannot say anything
+ about the object. */
+ result = -1;
+ }
+ else
+ {
+ if (S_ISDIR (st.st_mode))
+ {
+ /* Remember the device of the initial directory in case
+ FTW_MOUNT is given. */
+ data.dev = st.st_dev;
+
+ /* We know this directory now. */
+ if (!(flags & FTW_PHYS))
+ result = add_object (&data, &st);
+
+ if (result == 0)
+ result = ftw_dir (&data, &st);
+ }
+ else
+ {
+ int flag = S_ISLNK (st.st_mode) ? FTW_SL : FTW_F;
+
+ result = (*data.func) (data.dirbuf, &st, data.cvt_arr[flag],
+ &data.ftw);
+ }
+ }
+ }
/* Return to the start directory (if necessary). */
if (cwd != NULL)
tp = &str[1];
while (tp[0] != '\0' && tp[0] != '>')
- if (tp[0] == '\\')
- if (tp[1] != '\0')
- tp += 2;
- else
- ++tp;
+ if (tp[0] == '\\' && tp[1] != '\0')
+ tp += 2;
else
++tp;
/* Read the password. */
nread = __getline (&buf, &bufsize, in);
if (buf != NULL)
- if (nread < 0)
- buf[0] = '\0';
- else if (buf[nread - 1] == '\n')
- {
- /* Remove the newline. */
- buf[nread - 1] = '\0';
- if (tty_changed)
- /* Write the newline that was not echoed. */
- putc_unlocked ('\n', out);
- }
+ {
+ if (nread < 0)
+ buf[0] = '\0';
+ else if (buf[nread - 1] == '\n')
+ {
+ /* Remove the newline. */
+ buf[nread - 1] = '\0';
+ if (tty_changed)
+ /* Write the newline that was not echoed. */
+ putc_unlocked ('\n', out);
+ }
+ }
/* Restore the original setting. */
if (tty_changed)
usage ();
value = sysconf (c->call_name);
if (value == -1l)
- if (c->call_name == _SC_UINT_MAX
- || c->call_name == _SC_ULONG_MAX)
- printf ("%lu\n", value);
- else
- puts (_("undefined"));
+ {
+ if (c->call_name == _SC_UINT_MAX
+ || c->call_name == _SC_ULONG_MAX)
+ printf ("%lu\n", value);
+ else
+ puts (_("undefined"));
+ }
else
printf ("%ld\n", value);
exit (0);
else
{
if (opterr)
- if (argv[optind - 1][1] == '-')
- /* --option */
- fprintf (stderr,
- _("%s: option `--%s' doesn't allow an argument\n"),
- argv[0], pfound->name);
- else
- /* +option or -option */
- fprintf (stderr,
- _("%s: option `%c%s' doesn't allow an argument\n"),
- argv[0], argv[optind - 1][0], pfound->name);
+ {
+ if (argv[optind - 1][1] == '-')
+ /* --option */
+ fprintf (stderr,
+ _("%s: option `--%s' doesn't allow an argument\n"),
+ argv[0], pfound->name);
+ else
+ /* +option or -option */
+ fprintf (stderr,
+ _("%s: option `%c%s' doesn't allow an argument\n"),
+ argv[0], argv[optind - 1][0], pfound->name);
+ }
nextchar += strlen (nextchar);
/* Sort out quoting */
if (words[*offset] == '\'')
+ {
if (quoted == 0)
{
quoted = 1;
quoted = 0;
continue;
}
+ }
else if (words[*offset] == '"')
- if (quoted == 0)
- {
- quoted = 2;
- continue;
- }
- else if (quoted == 2)
- {
- quoted = 0;
- continue;
- }
+ {
+ if (quoted == 0)
+ {
+ quoted = 2;
+ continue;
+ }
+ else if (quoted == 2)
+ {
+ quoted = 0;
+ continue;
+ }
+ }
/* Sort out other special characters */
if (quoted != 1 && words[*offset] == '$')