while (get_header_cpio(archive_handle) == EXIT_SUCCESS);
- return(EXIT_SUCCESS);
+ return EXIT_SUCCESS;
}
unpack_ar_archive(ar_archive);
/* Cleanup */
- close (ar_archive->src_fd);
+ close(ar_archive->src_fd);
- return(EXIT_SUCCESS);
+ return EXIT_SUCCESS;
}
bytebuffer_offset++;
*current += 8;
}
- return(bitbuffer);
+ return bitbuffer;
}
/*
/* Accept any non-null name, its not really a filter at all */
char filter_accept_all(archive_handle_t *archive_handle)
{
- if (archive_handle->file_header->name) {
- return(EXIT_SUCCESS);
- } else {
- return(EXIT_FAILURE);
- }
+ if (archive_handle->file_header->name)
+ return EXIT_SUCCESS;
+ return EXIT_FAILURE;
}
*/
char filter_accept_list(archive_handle_t *archive_handle)
{
- if (find_list_entry(archive_handle->accept, archive_handle->file_header->name)) {
- return(EXIT_SUCCESS);
- } else {
- return(EXIT_FAILURE);
- }
+ if (find_list_entry(archive_handle->accept, archive_handle->file_header->name))
+ return EXIT_SUCCESS;
+ return EXIT_FAILURE;
}
#ifdef CONFIG_FEATURE_DEB_TAR_GZ
if (strcmp(name_ptr, ".gz") == 0) {
archive_handle->action_data_subarchive = get_header_tar_gz;
- return(EXIT_SUCCESS);
+ return EXIT_SUCCESS;
}
#endif
#ifdef CONFIG_FEATURE_DEB_TAR_BZ2
if (strcmp(name_ptr, ".bz2") == 0) {
archive_handle->action_data_subarchive = get_header_tar_bz2;
- return(EXIT_SUCCESS);
+ return EXIT_SUCCESS;
}
#endif
if (ENABLE_FEATURE_DEB_TAR_LZMA && !strcmp(name_ptr, ".lzma")) {
archive_handle->action_data_subarchive = get_header_tar_lzma;
- return(EXIT_SUCCESS);
+ return EXIT_SUCCESS;
}
}
- return(EXIT_FAILURE);
+ return EXIT_FAILURE;
}
/* If the key is in a reject list fail */
if (reject_entry) {
- return(EXIT_FAILURE);
+ return EXIT_FAILURE;
}
accept_entry = find_list_entry2(archive_handle->accept, key);
/* Fail if an accept list was specified and the key wasnt in there */
if ((accept_entry == NULL) && archive_handle->accept) {
- return(EXIT_FAILURE);
+ return EXIT_FAILURE;
}
/* Accepted */
- return(EXIT_SUCCESS);
+ return EXIT_SUCCESS;
}
/* dont use xread as we want to handle the error ourself */
if (read(archive_handle->src_fd, ar.raw, 60) != 60) {
/* End Of File */
- return(EXIT_FAILURE);
+ return EXIT_FAILURE;
}
/* ar header starts on an even byte (2 byte aligned)
/* Set the file pointer to the correct spot, we may have been reading a compressed file */
lseek(archive_handle->src_fd, archive_handle->offset, SEEK_SET);
- return(EXIT_SUCCESS);
+ return EXIT_SUCCESS;
}
for (i = 0; (t = getc(f)) != '\n'; i++) {
if (t == EOF) {
if (i == 0)
- return (0);
+ return 0;
break;
}
sum = sum * 127 + t;
for (i = 0; (t = getc(f)) != '\n'; i++) {
if (t == EOF) {
if (i == 0)
- return (0);
+ return 0;
break;
}
sum = sum * 127 + t;
continue;
case EOF:
if (i == 0)
- return (0);
+ return 0;
/* FALLTHROUGH */
case '\n':
break;
if ((flags & (D_EMPTY1 | D_EMPTY2)) || stb1.st_size != stb2.st_size ||
(stb1.st_mode & S_IFMT) != (stb2.st_mode & S_IFMT))
- return (1);
+ return 1;
while (1) {
i = fread(buf1, 1, sizeof(buf1), f1);
j = fread(buf2, 1, sizeof(buf2), f2);
if (i != j)
- return (1);
+ return 1;
if (i == 0 && j == 0) {
if (ferror(f1) || ferror(f2))
- return (1);
- return (0);
+ return 1;
+ return 0;
}
if (memcmp(buf1, buf2, i) != 0)
- return (1);
+ return 1;
}
}
int y, x = 1;
if (n == 0)
- return (0);
+ return 0;
do {
y = x;
int i, j, c, lastc, col, nc;
if (a > b)
- return (0);
+ return 0;
for (i = a; i <= b; i++) {
fseek(lb, f[i - 1], SEEK_SET);
nc = f[i] - f[i - 1];
for (j = 0, lastc = '\0'; j < nc; j++, lastc = c) {
if ((c = getc(lb)) == EOF) {
puts("\n\\ No newline at end of file");
- return (0);
+ return 0;
}
if (c == '\t' && (cmd_flags & FLAG_t)) {
do {
}
}
}
- return (0);
+ return 0;
}
static int asciifile(FILE * f)
#endif
if ((cmd_flags & FLAG_a) || f == NULL)
- return (1);
+ return 1;
#if ENABLE_FEATURE_DIFF_BINARY
rewind(f);
cnt = fread(buf, 1, sizeof(buf), f);
for (i = 0; i < cnt; i++) {
if (!isprint(buf[i]) && !isspace(buf[i])) {
- return (0);
+ return 0;
}
}
#endif
- return (1);
+ return 1;
}
/* dump accumulated "unified" diff changes */
}
} while (old_argv_ptr);
}
- return(ret);
+ return ret;
}
{
if(ENABLE_FEATURE_CLEAN_UP && isdir) free(dest);
}
- return(ret);
+ return ret;
}
sync();
- return(EXIT_SUCCESS);
+ return EXIT_SUCCESS;
}
unsigned int euid = geteuid();
if (stat(path, &st) < 0)
- return (-1);
+ return -1;
if (euid == 0) {
/* Root can read or write any file. */
if (mode != X_OK)
- return (0);
+ return 0;
/* Root can execute any file that has any one of the execute
bits set. */
if (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))
- return (0);
+ return 0;
}
if (st.st_uid == euid) /* owner */
mode <<= 3;
if (st.st_mode & mode)
- return (0);
+ return 0;
- return (-1);
+ return -1;
}
static void initialize_group_array(void)
/* Short-circuit if possible, maybe saving a call to getgroups(). */
if (gid == getgid() || gid == getegid())
- return (1);
+ return 1;
if (ngroups == 0)
initialize_group_array();
/* Search through the list looking for GID. */
for (i = 0; i < ngroups; i++)
if (gid == group_array[i])
- return (1);
+ return 1;
- return (0);
+ return 0;
}
outvec[(GCC4_IS_STUPID)output[i]] = TRUE;
}
convert();
- return (0);
+ return 0;
}
if (entries == -1) {
if (test_mode & 2) {
- return(2);
+ return 2;
}
bb_perror_msg_and_die("cannot open '%s'", arg0);
}
blkid_put_cache(cache);
- return (0);
+ return 0;
}
#endif
printf("%s: error probing devices\n", argv[0]);
blkid_put_cache(cache);
- return (0);
+ return 0;
}
#endif
dev = blkid_get_dev(cache, argv[1], BLKID_DEV_NORMAL);
if (!dev) {
printf("%s: %s has an unsupported type\n", argv[0], argv[1]);
- return (1);
+ return 1;
}
printf("%s is type %s\n", argv[1], dev->bid_type ?
dev->bid_type : "(null)");
printf("\tuuid is %s\n", dev->bid_uuid);
blkid_free_dev(dev);
- return (0);
+ return 0;
}
#endif
printf("Device %s: (%s, %s) %s\n", blkid_dev_devname(dev),
search_type, search_value ? search_value : "NULL",
found ? "FOUND" : "NOT FOUND");
- return(!found);
+ return !found;
}
printf("Device %s...\n", blkid_dev_devname(dev));
blkid_tag_iterate_end(iter);
blkid_put_cache(cache);
- return (0);
+ return 0;
}
#endif
if (*control >= ctx->dir_info_count)
return 0;
- return(ctx->dir_info + (*control)++);
+ return ctx->dir_info + (*control)++;
}
/*
if (*control >= ctx->dx_dir_info_count)
return 0;
- return(ctx->dx_dir_info + (*control)++);
+ return ctx->dx_dir_info + (*control)++;
}
#endif /* ENABLE_HTREE */
errout:
ea_refcount_free(refcount);
- return(retval);
+ return retval;
}
/*
p->dir = dir;
sd->count--;
- return(sd->count ? 0 : DIRENT_ABORT);
+ return sd->count ? 0 : DIRENT_ABORT;
}
errout:
ext2fs_free_icount(icount);
- return(retval);
+ return retval;
}
errcode_t ext2fs_create_icount(ext2_filsys fs, int flags,
free(s);
}
free(p);
- return(s);
+ return s;
}
static int progress_active(void)
#include "uuidP.h"
#include <string.h>
-#define UUCMP(u1,u2) if (u1 != u2) return((u1 < u2) ? -1 : 1);
+#define UUCMP(u1,u2) if (u1 != u2) return (u1 < u2) ? -1 : 1;
int uuid_compare(const uuid_t uu1, const uuid_t uu2)
{
i++;
}
- return(i);
+ return i;
}
/* If patch_level is -1 it will remove all directory names
filename_start_ptr = temp + 1;
}
- return(xstrdup(filename_start_ptr));
+ return xstrdup(filename_start_ptr);
}
static int file_doesnt_exist(const char *filename)
{
struct stat statbuf;
- return(stat(filename, &statbuf));
+ return stat(filename, &statbuf);
}
int patch_main(int argc, char **argv)
* 1 = Some hunks failed
* 2 = More serious problems
*/
- return(ret);
+ return ret;
}
}
//-----------------------------------------------------------
- return (0);
+ return 0;
}
static void edit_file(Byte * fn)
// unrecognised address- assume -1
*addr = -1;
}
- return (p);
+ return p;
}
static Byte *get_address(Byte *p, int *b, int *e) // get two colon addrs, if present
ga0:
while (isblnk(*p))
p++; // skip over trailing spaces
- return (p);
+ return p;
}
#ifdef CONFIG_FEATURE_VI_SETOPTS
{
while (p > text && p[-1] != '\n')
p--; // go to cur line B-o-l
- return (p);
+ return p;
}
static Byte *end_line(Byte * p) // return pointer to NL of cur line line
{
while (p < end - 1 && *p != '\n')
p++; // go to cur line E-o-l
- return (p);
+ return p;
}
static inline Byte *dollar_line(Byte * p) // return pointer to just before NL line
// Try to stay off of the Newline
if (*p == '\n' && (p - begin_line(p)) > 0)
p--;
- return (p);
+ return p;
}
static Byte *prev_line(Byte * p) // return pointer first char prev line
if (p[-1] == '\n' && p > text)
p--; // step to prev line
p = begin_line(p); // goto begining of prev line
- return (p);
+ return p;
}
static Byte *next_line(Byte * p) // return pointer first char next line
p = end_line(p);
if (*p == '\n' && p < end - 1)
p++; // step to next line
- return (p);
+ return p;
}
//----- Text Information Routines ------------------------------
for (cnt = 0; cnt < rows - 2; cnt++)
q = next_line(q);
q = end_line(q);
- return (q);
+ return q;
}
static int count_lines(Byte * start, Byte * stop) // count line from start to stop
for (q = text; li > 1; li--) {
q = next_line(q);
}
- return (q);
+ return q;
}
//----- Dot Movement Routines ----------------------------------
co++; // display as ^X, use 2 columns
}
} while (++co <= l && p++ < end);
- return (p);
+ return p;
}
static void dot_next(void)
p = text;
indicate_error('2');
}
- return (p);
+ return p;
}
//----- Helper Utility Routines --------------------------------
} else {
p = p - i;
}
- return (p);
+ return p;
#endif /*REGEX_SEARCH */
}
#endif /* CONFIG_FEATURE_VI_SEARCH */
}
#endif /* CONFIG_FEATURE_VI_SETOPTS */
}
- return (p);
+ return p;
}
static Byte *stupid_insert(Byte * p, Byte c) // stupidly insert the char c at 'p'
file_modified++; // has the file been modified
p++;
}
- return (p);
+ return p;
}
static Byte find_range(Byte ** start, Byte ** stop, Byte c)
break;
p += dir; // move to next char
}
- return (p);
+ return p;
}
// find matching char of pair () [] {}
}
if (level != 0)
q = NULL; // indicate no match
- return (q);
+ return q;
}
#ifdef CONFIG_FEATURE_VI_SETOPTS
end = end + size; // adjust the new END
file_modified++; // has the file been modified
thm0:
- return (p);
+ return p;
}
// close a hole in text[]
// we cannot cross NL boundaries
p = start;
if (*p == '\n')
- return (p);
+ return p;
// dont go past a NewLine
for (; p + 1 <= stop; p++) {
if (p[1] == '\n') {
if (yf == YANKDEL) {
p = text_hole_delete(start, stop);
} // delete lines
- return (p);
+ return p;
}
static void show_help(void)
#ifdef CONFIG_FEATURE_VI_YANKMARK
psb("Put %d lines (%d chars) from [%c]", cnt, i, what_reg());
#endif /* CONFIG_FEATURE_VI_YANKMARK */
- return (p);
+ return p;
}
#endif /* CONFIG_FEATURE_VI_YANKMARK || CONFIG_FEATURE_VI_COLON || CONFIG_FEATURE_VI_CRASHME */
memset(t, '\0', cnt + 1); // clear new text[]
strncpy((char *) t, (char *) p, cnt); // copy text[] into bufer
reg[dest] = t;
- return (p);
+ return p;
}
static Byte what_reg(void)
context_start = prev_line(prev_line(prev_line(p)));
context_end = next_line(next_line(next_line(p)));
}
- return (p);
+ return p;
}
#endif /* CONFIG_FEATURE_VI_YANKMARK */
int cnt, sr;
if (fn == 0 || strlen((char *)fn) <= 0)
- return (-1);
+ return -1;
cnt = -1;
sr = stat((char *) fn, &st_buf); // see if file exists
if (sr >= 0) {
// FIXIT- use the correct umask()
fd = open((char *) fn, (O_WRONLY | O_CREAT | O_TRUNC), 0664);
if (fd < 0)
- return (-1);
+ return -1;
cnt = last - first + 1;
charcnt = write(fd, first, cnt);
if (charcnt == cnt) {
if (argv) {
_argv = argv;
- return (1);
+ return 1;
}
for (;;) {
if (*_argv) {
statok = done = 1;
} else {
if (done++)
- return (0);
+ return 0;
statok = 0;
}
if (bb_dump_skip)
if (*_argv)
++_argv;
if (!bb_dump_skip)
- return (1);
+ return 1;
}
/* NOTREACHED */
}
/* size */
if (!new_p || (length = strlen(new_p)) < CONFIG_PASSWORD_MINLEN)
- return("too short");
+ return "too short";
/* no username as-is, as sub-string, reversed, capitalized, doubled */
if (string_checker(new_p, pw->pw_name)) {
if(ENABLE_DEVFSD_VERBOSE)
msg_logger(LOG_ERR,"unknown %s: %s, defaulting to %cid=0", msg, string, msg[0]);
- return (0);
+ return 0;
}/* End Function get_uid_gid */
static mode_t get_mode (const char *string)
if( i >= 0 && i <= 3)
{
debug_msg_logger(LOG_INFO, "%s: i=%d %s", __FUNCTION__, i ,field_names[i+7]);
- return(field_names[i+7]);
+ return field_names[i+7];
}
if(i == 4 )
debug_msg_logger(LOG_INFO, __FUNCTION__);
if ( !make_dir_tree (newpath) )
- return (-1);
+ return -1;
- if (symlink (oldpath, newpath) != 0)
- {
- if (errno != EEXIST)
- {
+ if (symlink (oldpath, newpath) != 0) {
+ if (errno != EEXIST) {
debug_msg_logger(LOG_ERR, "%s: %s to %s: %m", __FUNCTION__, oldpath, newpath);
- return (-1);
+ return -1;
}
}
- return (0);
+ return 0;
} /* End Function mksymlink */
debug_msg_logger(LOG_ERR, "%s: %s: %m",__FUNCTION__, path);
return (FALSE);
}
- return(TRUE);
+ return TRUE;
} /* End Function make_dir_tree */
static int expand_expression(char *output, unsigned int outsize,
*license = value+1;
for (i = 0; i < sizeof(gpl_licenses)/sizeof(gpl_licenses[0]); ++i) {
if (strcmp(value+1, gpl_licenses[i]) == 0)
- return(0);
+ return 0;
}
- return(2);
+ return 2;
}
if (strchr(ptr, '\0'))
ptr = strchr(ptr, '\0') + 1;
ptr = endptr;
}
}
- return(1);
+ return 1;
}
#define TAINT_FILENAME "/proc/sys/kernel/tainted"
if(fp)
fclose(fp);
free(tmp1);
- if(!tmp1) {
+ if(!tmp1)
free(m_name);
- }
free(m_filename);
#endif
- return(exit_status);
+ return exit_status;
}
free(module_names);
#endif
- return( 0);
+ return 0;
}
#else /* CONFIG_FEATURE_QUERY_MODULE_INTERFACE */
while (nmod != pnmod) {
if (syscall(__NR_delete_module, NULL, flags) != 0) {
- if (errno==EFAULT)
- return(ret);
+ if (errno == EFAULT)
+ return ret;
bb_perror_msg_and_die("rmmod");
}
pnmod = nmod;
}
}
- return(ret);
+ return ret;
}
ftpcmd("TYPE I", NULL, control_stream, buf);
- return(control_stream);
+ return control_stream;
}
#if !ENABLE_FTPGET
}
ftpcmd("QUIT", NULL, control_stream, buf);
- return(EXIT_SUCCESS);
+ return EXIT_SUCCESS;
}
#endif
}
ftpcmd("QUIT", NULL, control_stream, buf);
- return(EXIT_SUCCESS);
+ return EXIT_SUCCESS;
}
#endif
/* Connect/Setup/Configure the FTP session */
control_stream = ftp_login(server);
- return(ftp_action(server, control_stream, argv[optind + 1], argv[optind + 2]));
+ return ftp_action(server, control_stream, argv[optind + 1], argv[optind + 2]);
}
INTOFF;
*app = freealias(*app);
INTON;
- return (0);
+ return 0;
}
- return (1);
+ return 1;
}
static void
for (ap = atab[i]; ap; ap = ap->next) {
printalias(ap);
}
- return (0);
+ return 0;
}
while ((n = *++argv) != NULL) {
if ((v = strchr(n+1, '=')) == NULL) { /* n+1: funny ksh stuff */
while ((i = nextopt("a")) != '\0') {
if (i == 'a') {
rmaliases();
- return (0);
+ return 0;
}
}
for (i = 0; *argptr; argptr++) {
/* protect geting var value, is number now */
numptr_m1->var = NULL;
return 0;
-err: return(-1);
+ err:
+ return -1;
}
/* longest must first */
if (ch < n_history) {
get_previous_history(); /* save the current history line */
- return (cur_history = ch+1);
+ cur_history = ch + 1;
+ return cur_history;
} else {
beep();
return 0;
if (i==fg_pipe->num_progs-1)
rcode=WEXITSTATUS(status);
(fg_pipe->num_progs)--;
- return(rcode);
+ return rcode;
}
}
}
#endif
final_return:
- return(opt?opt:last_return_code);
+ return opt ? opt : last_return_code;
}
static char *insert_var_value(char *inp)
if (f < 0) {
prs(s);
err(": cannot open");
- return (1);
+ return 1;
}
} else
f = 0;
next(remap(f));
- return (0);
+ return 0;
}
if (f) {
quitenv();
- return (1);
+ return 1;
}
ep = (struct env *) space(sizeof(*ep));
e.oenv = ep;
e.errpt = errpt;
- return (0);
+ return 0;
}
static void quitenv(void)
{
while (*s1)
if (any(*s1++, s2))
- return (1);
- return (0);
+ return 1;
+ return 0;
}
/*
{
while (*s)
if (*s++ == c)
- return (1);
- return (0);
+ return 1;
+ return 0;
}
static char *putn(int n)
DBGPRINTF7(("ISASSIGN: enter, s=%s\n", s));
if (!isalpha((int) *s) && *s != '_')
- return (0);
+ return 0;
for (; *s != '='; s++)
if (*s == 0 || (!isalnum(*s) && *s != '_'))
- return (0);
+ return 0;
- return (1);
+ return 1;
}
static int assign(char *s, int cf)
DBGPRINTF7(("ASSIGN: enter, s=%s, cf=%d\n", s, cf));
if (!isalpha(*s) && *s != '_')
- return (0);
+ return 0;
for (cp = s; *cp != '='; cp++)
if (*cp == 0 || (!isalnum(*cp) && *cp != '_'))
- return (0);
+ return 0;
vp = lookup(s);
nameval(vp, ++cp, cf == COPYV ? (char *) NULL : s);
if (cf != COPYV)
vp->status &= ~GETCELL;
- return (1);
+ return 1;
}
static int checkname(char *cp)
DBGPRINTF7(("CHECKNAME: enter, cp=%s\n", cp));
if (!isalpha(*cp++) && *(cp - 1) != '_')
- return (0);
+ return 0;
while (*cp)
if (!isalnum(*cp++) && *(cp - 1) != '_')
- return (0);
- return (1);
+ return 0;
+ return 1;
}
static void putvlist(int f, int out)
{
for (; *n1 != '=' && *n1 != 0; n1++)
if (*n2++ != *n1)
- return (0);
+ return 0;
return (*n2 == 0 || *n2 == '=');
}
int sc, pc;
if (s == NULL || p == NULL)
- return (0);
+ return 0;
while ((pc = *p++ & CMASK) != '\0') {
sc = *s++ & QMASK;
switch (pc) {
case '[':
if ((p = cclass(p, sc)) == NULL)
- return (0);
+ return 0;
break;
case '?':
if (sc == 0)
- return (0);
+ return 0;
break;
case '*':
s--;
do {
if (*p == '\0' || gmatch(s, p))
- return (1);
+ return 1;
} while (*s++ != '\0');
- return (0);
+ return 0;
default:
if (sc != (pc & ~QUOTE))
- return (0);
+ return 0;
}
}
return (*s == 0);
if ((c = yylex(cf)) != '<' && c != '>') {
peeksym = c;
- return (0);
+ return 0;
}
i = yylval.i;
markhere(yylval.cp, iop);
DBGPRINTF7(("SYNIO: returning 1\n"));
- return (1);
+ return 1;
}
static void musthave(int c, int cf)
}
DBGPRINTF7(("RLOOKUP: NO match, returning 0\n"));
- return (0); /* Not a shell multiline */
+ return 0; /* Not a shell multiline */
}
static struct op *newtp(void)
DBGPRINTF8(("COLLECT: return 0, line is %s\n", line));
- return (0);
+ return 0;
}
/* "multiline commands" helper func */
if (t == NULL) {
DBGPRINTF4(("EXECUTE: enter, t==null, returning.\n"));
- return (0);
+ return 0;
}
DBGPRINTF(("EXECUTE: t=%p, t->type=%d (%s), t->words is %s\n", t,
if (newpid == -1) {
DBGPRINTF(("FORKEXEC: ERROR, cannot vfork()!\n"));
- return (-1);
+ return -1;
}
/* moved up
if (i == -1)
- return(rv);
+ return rv;
*/
if (pin != NULL)
err("piping to/from shell builtins not yet done");
if (forked)
_exit(-1);
- return (-1);
+ return -1;
}
#endif
err(": cannot redirect shell command");
if (forked)
_exit(-1);
- return (-1);
+ return -1;
}
while (*iopp)
if (iosetup(*iopp++, pin != NULL, pout != NULL)) {
iop->io_unit = iop->io_flag & (IOREAD | IOHERE) ? 0 : 1;
if (pipein && iop->io_unit == 0)
- return (0);
+ return 0;
if (pipeout && iop->io_unit == 1)
- return (0);
+ return 0;
msg = iop->io_flag & (IOREAD | IOHERE) ? "open" : "create";
if ((iop->io_flag & IOHERE) == 0) {
cp = iop->io_name;
if ((cp = evalstr(cp, DOSUB | DOTRIM)) == NULL)
- return (1);
+ return 1;
}
if (iop->io_flag & IODUP) {
if (cp[1] || (!isdigit(*cp) && *cp != '-')) {
prs(cp);
err(": illegal >& argument");
- return (1);
+ return 1;
}
if (*cp == '-')
iop->io_flag = IOCLOSE;
case IOCLOSE:
close(iop->io_unit);
- return (0);
+ return 0;
}
if (u < 0) {
prs(cp);
prs(": cannot ");
warn(msg);
- return (1);
+ return 1;
} else {
if (u != iop->io_unit) {
dup2(u, iop->io_unit);
close(u);
}
}
- return (0);
+ return 0;
}
static void echo(char **wp)
static int dolabel(struct op *t)
{
- return (0);
+ return 0;
}
static int dochdir(struct op *t)
else if (chdir(cp) < 0)
er = ": bad directory";
else
- return (0);
+ return 0;
prs(cp != NULL ? cp : "cd");
err(er);
- return (1);
+ return 1;
}
static int doshift(struct op *t)
n = t->words[1] ? getn(t->words[1]) : 1;
if (dolc < n) {
err("nothing to shift");
- return (1);
+ return 1;
}
dolv[n] = dolv[0];
dolv += n;
dolc -= n;
setval(lookup("#"), putn(dolc));
- return (0);
+ return 0;
}
/*
prs(t->words[0]);
prs(": ");
err(cp);
- return (1);
+ return 1;
}
static int doumask(struct op *t)
n = n * 8 + (*cp - '0');
umask(n);
}
- return (0);
+ return 0;
}
static int doexec(struct op *t)
t->ioact = NULL;
for (i = 0; (t->words[i] = t->words[i + 1]) != NULL; i++);
if (i == 0)
- return (1);
+ return 1;
execflg = 1;
ofail = failpt;
if (setjmp(failpt = ex) == 0)
execute(t, NOPIPE, NOPIPE, FEXEC);
failpt = ofail;
execflg = 0;
- return (1);
+ return 1;
}
static int dodot(struct op *t)
if ((cp = t->words[1]) == NULL) {
DBGPRINTF(("DODOT: bad args, ret 0\n"));
- return (0);
+ return 0;
} else {
DBGPRINTF(("DODOT: cp is %s\n", cp));
}
prs(cp);
err(": not found");
- return (-1);
+ return -1;
}
static int dowait(struct op *t)
if ((cp = t->words[1]) != NULL) {
i = getn(cp);
if (i == 0)
- return (0);
+ return 0;
} else
i = -1;
setstatus(waitfor(i, 1));
- return (0);
+ return 0;
}
static int doread(struct op *t)
if (t->words[1] == NULL) {
err("Usage: read name ...");
- return (1);
+ return 1;
}
for (wp = t->words + 1; *wp; wp++) {
for (cp = e.linep; !nl && cp < elinep - 1; cp++)
prs(trap[i]);
prs("\n");
}
- return (0);
+ return 0;
}
resetsig = isdigit(*t->words[1]);
for (i = resetsig ? 1 : 2; t->words[i] != NULL; ++i) {
setsig(n, SIG_DFL);
}
}
- return (0);
+ return 0;
}
static int getsig(char *s)
} while (--nl);
if (nl) {
err("bad break/continue level");
- return (1);
+ return 1;
}
isbreak = val;
longjmp(bc->brkpt, 1);
leave();
/* NOTREACHED */
- return (0);
+ return 0;
}
static int doexport(struct op *t)
{
rdexp(t->words + 1, export, EXPORT);
- return (0);
+ return 0;
}
static int doreadonly(struct op *t)
{
rdexp(t->words + 1, ronly, RONLY);
- return (0);
+ return 0;
}
static void rdexp(char **wp, void (*f) (struct var *), int key)
if ((cp = t->words[1]) == NULL) {
for (vp = vlist; vp; vp = vp->next)
varput(vp->name, 1);
- return (0);
+ return 0;
}
if (*cp == '-') {
/* bad: t->words++; */
setval(lookup("#"), putn(dolc));
setarea((char *) (dolv - 1), 0);
}
- return (0);
+ return 0;
}
static void varput(char *s, int out)
gflg = 0;
if (cp == NULL)
- return (0);
+ return 0;
if (!anys("$`'\"", cp) &&
!anys(ifs->value, cp) && ((f & DOGLOB) == 0 || !anys("[*?", cp))) {
if (f & DOTRIM)
unquote(cp);
*wbp = addword(cp, *wbp);
- return (1);
+ return 1;
}
if (newenv(setjmp(errpt = ev)) == 0) {
PUSHIO(aword, cp, strchar);
switch (c = subgetc('"', foundequals)) {
case 0:
if (sp == e.linep)
- return (0);
+ return 0;
*e.linep++ = 0;
return (sp);
if (!INSUB() && ec != '\'') {
if (c == '`') {
if (grave(quoted) == 0)
- return (0);
+ return 0;
e.iop->task = XGRAVE;
goto again;
}
/* should check dollar */
e.linep = s;
PUSHIO(awordlist, dolv + 1, dolchar);
- return (0);
+ return 0;
} else { /* trap the nasty ${=} */
s[0] = '1';
s[1] = 0;
}
e.linep = s;
PUSHIO(aword, dolp, quoted ? qstrchar : strchar);
- return (0);
+ return 0;
}
/*
for (cp = e.iop->argp->aword; *cp != '`'; cp++)
if (*cp == 0) {
err("no closing `");
- return (0);
+ return 0;
}
/* string copy with dollar expansion */
break;
default:
err("unclosed ${\n");
- return (0);
+ return 0;
}
if (operator) {
src++;
alt_value[alt_index] = 0;
if (*src != '}') {
err("unclosed ${\n");
- return (0);
+ return 0;
}
}
src++;
alt_value : vp->value;
else if (operator == '?') {
err(alt_value);
- return (0);
+ return 0;
} else if (alt_index && (operator != '+')) {
value = alt_value;
if (operator == '=')
*dest = '\0';
if (openpipe(pf) < 0)
- return (0);
+ return 0;
while ((i = vfork()) == -1 && errno == EAGAIN);
if (i < 0) {
closepipe(pf);
err((char *) bb_msg_memory_exhausted);
- return (0);
+ return 0;
}
if (i != 0) {
waitpid(i, NULL, 0);
PUSHIO(afile, remap(pf[0]),
(int (*)(struct ioarg *)) ((quoted) ? qgravechar :
gravechar));
- return (1);
+ return 1;
}
/* allow trapped signals */
/* XXX - Maybe this signal stuff should go as well? */
wd = wb->w_words;
for (i = 0; i < wb->w_nword; i++)
if (anys(spcl, *wd++))
- return (1);
- return (0);
+ return 1;
+ return 0;
}
static int xstrcmp(char *p1, char *p2)
if (e.iop >= iostack) {
RCPRINTF(("READC: return 0, e.iop %p\n", e.iop));
- return (0);
+ return 0;
}
DBGPRINTF(("READC: leave()...\n"));
leave();
/* NOTREACHED */
- return (0);
+ return 0;
}
static void ioecho(char c)
int c;
if (ap->aword == NULL)
- return (0);
+ return 0;
if ((c = *ap->aword++) == 0) {
ap->aword = NULL;
return ('\n');
char **wl;
if ((wl = ap->awordlist) == NULL)
- return (0);
+ return 0;
if (*wl != NULL) {
if ((c = *(*wl)++) != 0)
return (c & 0177);
if ((wp = *ap->awordlist++) != NULL) {
PUSHIO(aword, wp, *ap->awordlist == NULL ? strchar : xxchar);
- return (-1);
+ return -1;
}
- return (0);
+ return 0;
}
static int xxchar(struct ioarg *ap)
int c;
if (ap->aword == NULL)
- return (0);
+ return 0;
if ((c = *ap->aword++) == '\0') {
ap->aword = NULL;
return (' ');
int c;
if (ap->aword == NULL || (c = *ap->aword++) == 0)
- return (0);
+ return 0;
return (c);
}
int c;
if (ap->aword == NULL || (c = *ap->aword++) == 0)
- return (0);
+ return 0;
return (c | QUOTE);
}
(void) &tf;
#endif
if (hname == NULL)
- return (-1);
+ return -1;
DBGPRINTF7(("HEREIN: hname is %s, xdoll=%d\n", hname, xdoll));
hf = open(hname, 0);
if (hf < 0)
- return (-1);
+ return -1;
if (xdoll) {
char c;
tf = mkstemp(tname);
if (tf < 0)
- return (-1);
+ return -1;
if (newenv(setjmp(errpt = ev)) == 0) {
PUSHIO(afile, hf, herechar);
setbase(e.iop);
* Subtract the RFC 868 time to get Linux epoch
*/
- return(ntohl(nett) - RFC_868_BIAS);
+ return ntohl(nett) - RFC_868_BIAS;
}
int rdate_main(int argc, char **argv)