inode=`ls -i "$prefix/bin/busybox" | awk '{print $1}'`
sub_shell_it=`
cd "$prefix"
- for d in usr/sbin usr/bin sbin bin ; do
+ for d in usr/sbin usr/bin sbin bin; do
pd=$PWD
if [ -d "$d" ]; then
cd $d
mkdir -p $prefix/bin || exit 1
install -m 755 busybox $prefix/bin/busybox || exit 1
-for i in $h ; do
+for i in $h; do
appdir=`dirname $i`
mkdir -p $prefix/$appdir || exit 1
if [ "$2" = "--hardlinks" ]; then
static const char *describe_status(int status_num)
{
- int status_want, status_state ;
+ int status_want, status_state;
if (status_hashtable[status_num] == NULL || status_hashtable[status_num]->status == 0)
return "is not installed or flagged to be installed";
#ifdef DEBUG
# define Assert(cond,msg) { if (!(cond)) bb_error_msg(msg); }
# define Trace(x) fprintf x
-# define Tracev(x) {if (verbose) fprintf x ;}
-# define Tracevv(x) {if (verbose > 1) fprintf x ;}
-# define Tracec(c,x) {if (verbose && (c)) fprintf x ;}
-# define Tracecv(c,x) {if (verbose > 1 && (c)) fprintf x ;}
+# define Tracev(x) {if (verbose) fprintf x; }
+# define Tracevv(x) {if (verbose > 1) fprintf x; }
+# define Tracec(c,x) {if (verbose && (c)) fprintf x; }
+# define Tracecv(c,x) {if (verbose > 1 && (c)) fprintf x; }
#else
# define Assert(cond,msg)
# define Trace(x)
sum_s = ' ' * sizeof(tar.chksum);
#endif
sum_u = ' ' * sizeof(tar.chksum);
- for (i = 0; i < 148 ; i++) {
+ for (i = 0; i < 148; i++) {
sum_u += ((unsigned char*)&tar)[i];
#if ENABLE_FEATURE_TAR_OLDSUN_COMPATIBILITY
sum_s += ((signed char*)&tar)[i];
#endif
}
- for (i = 156; i < 512 ; i++) {
+ for (i = 156; i < 512; i++) {
sum_u += ((unsigned char*)&tar)[i];
#if ENABLE_FEATURE_TAR_OLDSUN_COMPATIBILITY
sum_s += ((signed char*)&tar)[i];
* (adapted from example in gnu wc.c)
*
* echo hello > /tmp/testfile &&
- * (dd ibs=1k skip=1 count=0 &> /dev/null ; wc -c) < /tmp/testfile
+ * (dd ibs=1k skip=1 count=0 &> /dev/null; wc -c) < /tmp/testfile
*
* for which 'wc -c' should output '0'.
*/
} else
return EOF;
- for (; *arg ; ++arg)
+ for (; *arg; ++arg)
(*fl) |= get_flag(*arg);
return 1;
else {
di = (struct dup_inode *) e2fsck_allocate_memory(ctx,
sizeof(struct dup_inode), "duplicate inode header");
- di->dir = (ino == EXT2_ROOT_INO) ? EXT2_ROOT_INO : 0 ;
+ di->dir = (ino == EXT2_ROOT_INO) ? EXT2_ROOT_INO : 0;
di->num_dupblocks = 0;
di->block_list = 0;
di->inode = *inode;
sb = (struct ext2_super_block *) buf;
for (blocksize = EXT2_MIN_BLOCK_SIZE;
- blocksize <= EXT2_MAX_BLOCK_SIZE ; blocksize *= 2) {
+ blocksize <= EXT2_MAX_BLOCK_SIZE; blocksize *= 2) {
superblock = blocksize*8;
if (blocksize == 1024)
superblock++;
if (remloc < 0)
return -1;
- for (i = remloc ; i < bb->num-1; i++)
+ for (i = remloc; i < bb->num - 1; i++)
bb->list[i] = bb->list[i+1];
bb->num--;
return 0;
/*
* Iterate over normal data blocks
*/
- for (i = 0; i < EXT2_NDIR_BLOCKS ; i++, ctx.bcount++) {
+ for (i = 0; i < EXT2_NDIR_BLOCKS; i++, ctx.bcount++) {
if (blocks[i] || (flags & BLOCK_FLAG_APPEND)) {
ret |= (*ctx.func)(fs, &blocks[i],
ctx.bcount, 0, i, priv_data);
c = fs->blocksize - start;
if (c > wanted)
c = wanted;
- left = EXT2_I_SIZE(&file->inode) - file->pos ;
+ left = EXT2_I_SIZE(&file->inode) - file->pos;
if (c > left)
c = left;
group_block = fs->super->s_first_data_block;
dest = (char *) fs->group_desc;
groups_per_block = fs->blocksize / sizeof(struct ext2_group_desc);
- for (i=0 ; i < fs->desc_blocks; i++) {
+ for (i = 0; i < fs->desc_blocks; i++) {
blk = ext2fs_descriptor_block_loc(fs, group_block, i);
retval = io_channel_read_blk(fs->io, blk, 1, dest);
if (retval)
interactive++;
return check_all();
}
- for (i = 0 ; i < num_devices; i++) {
+ for (i = 0; i < num_devices; i++) {
if (cancel_requested) {
if (!kill_sent) {
kill_all(SIGTERM);
static char *volume_label;
static char *mount_dir;
static char *journal_device = NULL;
-static int sync_kludge; /* Set using the MKE2FS_SYNC env. option */
+static int sync_kludge; /* Set using the MKE2FS_SYNC env. option */
static int sys_page_size = 4096;
static int linux_version_code = 0;
static int int_log2(int arg)
{
- int l = 0;
+ int l = 0;
arg >>= 1;
while (arg) {
{
int l;
- for (l=0; arg ; l++)
+ for (l = 0; arg; l++)
arg = arg / 10;
return l;
}
* don't check all the filesystems at the same time. We use a
* kludgy hack of using the UUID to derive a random jitter value.
*/
- for (i = 0, val = 0 ; i < sizeof(fs->super->s_uuid); i++)
+ for (i = 0, val = 0; i < sizeof(fs->super->s_uuid); i++)
val += fs->super->s_uuid[i];
fs->super->s_max_mnt_count += val % EXT2_DFL_MAX_MNT_COUNT;
for (pref = 0; pref < len[0] && pref < len[1] &&
file[0][pref + 1].value == file[1][pref + 1].value; pref++)
- ;
+ continue;
for (suff = 0; suff < len[0] - pref && suff < len[1] - pref &&
file[0][len[0] - suff].value == file[1][len[1] - suff].value;
suff++)
- ;
+ continue;
for (j = 0; j < 2; j++) {
sfile[j] = file[j] + pref;
slen[j] = len[j] - pref - suff;
format_line(buf, tp, li);
// skip to the end of the current text[] line
- while (tp < end && *tp++ != '\n') /*no-op*/ ;
+ while (tp < end && *tp++ != '\n') /*no-op*/;
// see if there are any changes between vitual screen and buf
changed = FALSE; // assume no change
" -m show min and max priorities"
#define chrt_example_usage \
- "$ chrt -r 4 sleep 900 ; x=$!\n" \
+ "$ chrt -r 4 sleep 900; x=$!\n" \
"$ chrt -f -p 3 $x\n" \
"You need CAP_SYS_NICE privileges to set scheduling attributes of a process"
"#!/bin/sh\n" \
"GETOPT=`getopt -o ab:c:: --long a-long,b-long:,c-long:: \\\n" \
" -n 'example.busybox' -- \"$@\"`\n" \
- "if [ $? != 0 ] ; then exit 1 ; fi\n" \
+ "if [ $? != 0 ]; then exit 1; fi\n" \
"eval set -- \"$GETOPT\"\n" \
- "while true ; do\n" \
+ "while true; do\n" \
" case $1 in\n" \
- " -a|--a-long) echo \"Option a\" ; shift ;;\n" \
- " -b|--b-long) echo \"Option b, argument '$2'\" ; shift 2 ;;\n" \
+ " -a|--a-long) echo \"Option a\"; shift;;\n" \
+ " -b|--b-long) echo \"Option b, argument '$2'\"; shift 2;;\n" \
" -c|--c-long)\n" \
" case \"$2\" in\n" \
- " \"\") echo \"Option c, no argument\"; shift 2 ;;\n" \
- " *) echo \"Option c, argument '$2'\" ; shift 2 ;;\n" \
- " esac ;;\n" \
- " --) shift ; break ;;\n" \
- " *) echo \"Internal error!\" ; exit 1 ;;\n" \
+ " \"\") echo \"Option c, no argument\"; shift 2;;\n" \
+ " *) echo \"Option c, argument '$2'\"; shift 2;;\n" \
+ " esac;;\n" \
+ " --) shift; break;;\n" \
+ " *) echo \"Internal error!\"; exit 1;;\n" \
" esac\n" \
"done\n"
"$ run-parts -a stop=now /etc/init.d\n\n" \
"Let's assume you have a script foo/dosomething:\n" \
"#!/bin/sh\n" \
- "for i in $*; do eval $i; done ; unset i\n" \
+ "for i in $*; do eval $i; done; unset i\n" \
"case \"$1\" in\n" \
- "start*) echo starting something ;;\n" \
- "stop*) set -x ; shutdown -h $stop ;;\n" \
+ "start*) echo starting something;;\n" \
+ "stop*) set -x; shutdown -h $stop;;\n" \
"esac\n\n" \
"Running this yields:\n" \
"$run-parts -a stop=+4m foo/\n" \
unsigned type xato##UT##_range(const char *str, unsigned type l, unsigned type u); \
unsigned type xato##UT##_sfx(const char *str, const struct suffix_mult *sfx); \
unsigned type xato##UT(const char *str); \
-type xstrto##T##_range_sfx(const char *str, int b, type l, type u, const struct suffix_mult *sfx) ;\
+type xstrto##T##_range_sfx(const char *str, int b, type l, type u, const struct suffix_mult *sfx); \
type xstrto##T##_range(const char *str, int b, type l, type u); \
type xato##T##_range_sfx(const char *str, type l, type u, const struct suffix_mult *sfx); \
type xato##T##_range(const char *str, type l, type u); \
if (frac >= 5) {
++val;
}
- f = "%llu%*c" /* fmt_no_tenths */ ;
+ f = "%llu%*c" /* fmt_no_tenths */;
frac = 1;
}
#endif
unsigned long v;
speed_t s;
- for (v = 0 ; v < 500000 ; v++) {
+ for (v = 0 ; v < 500000; v++) {
s = tty_value_to_baud(v);
if (s == (speed_t) -1) {
continue;
printf("-------------------------------\n");
- for (s = 0 ; s < 010017+1 ; s++) {
+ for (s = 0 ; s < 010017+1; s++) {
v = tty_baud_to_value(s);
if (!v) {
continue;
while (!bb__pgsreader(bb__parsegrent, &group, buff, sizeof(buff), grfile)) {
assert(group.gr_mem); /* Must have at least a NULL terminator. */
if (group.gr_gid != gid) {
- for (m=group.gr_mem ; *m ; m++) {
+ for (m = group.gr_mem; *m; m++) {
if (!strcmp(*m, user)) {
if (!(num_groups & 7)) {
gid_t *tmp = (gid_t *)
goto DO_UNLOCK;
}
- for (i=0 ; i < sizeof(_sp_off) ; i++) {
+ for (i = 0; i < sizeof(_sp_off); i++) {
f = ld_format;
x = *(const long *)(((const char *) p) + _sp_off[i]);
if (x == -1) {
}
/* Someone else's home directory */
for (ptr = ++input; !isspace(ch) && (ch != '/') && (ch != '\0'); ch = *++ptr)
- /* VOID */ ;
+ /* VOID */;
len = ptr - input;
if (len >= sizeof tmp)
goto st_expr_expand_out;
if (ch != '{') {
/* Simple variable expansion */
for (ptr = input; isalnum(ch) || (ch == '_') || (ch == ':'); ch = *++ptr)
- /* VOID */ ;
+ /* VOID */;
len = ptr - input;
if ((size_t)len >= sizeof tmp)
goto expand_variable_out;
.type = ARPHRD_SIT,
.print = UNSPEC_print,
.suppress_null_addr = 1
-} ;
+};
#endif
static const struct hwtype *const hwtypes[] = {
argc--;
argv++;
}
- _SL_ = oneline ? '\\' : '\n' ;
+ _SL_ = oneline ? '\\' : '\n';
*argcp = argc;
*argvp = argv;
}
fprintf(fp, "<");
flags &= ~IFF_RUNNING;
#define _PF(f) if (flags&IFF_##f) { \
- flags &= ~IFF_##f ; \
+ flags &= ~IFF_##f; \
fprintf(fp, #f "%s", flags ? "," : ""); }
_PF(LOOPBACK);
_PF(BROADCAST);
int col, i;
out1fmt("\nBuilt-in commands:\n-------------------\n");
- for (col = 0, i = 0; i < ARRAY_SIZE(builtintab) ; i++) {
+ for (col = 0, i = 0; i < ARRAY_SIZE(builtintab); i++) {
col += out1fmt("%c%s", ((col == 0) ? '\t' : ' '),
builtintab[i].name + 1);
if (col > 60) {
ullong last_p_start_pos = 0, p_start_pos;
int i, last_i = 0;
- for (i = 0 ; i < partitions; i++) {
+ for (i = 0; i < partitions; i++) {
if (i == 4) {
last_i = 4;
last_p_start_pos = 0;
printf("\nDisk %s: %d heads, %d sectors, %d cylinders\n\n",
disk_device, heads, sectors, cylinders);
printf("Nr AF Hd Sec Cyl Hd Sec Cyl Start Size ID\n");
- for (i = 0 ; i < partitions; i++) {
+ for (i = 0; i < partitions; i++) {
pe = &ptes[i];
p = (extend ? pe->ext_pointer : pe->part_table);
if (p != NULL) {
add2freelist(unsigned int f, unsigned int l)
{
int i;
- for (i = 0; i < 17 ; i++)
+ for (i = 0; i < 17; i++)
if (freelist[i].last == 0)
break;
setfreelist(i, f, l);
{
int i;
- for (i = 0; i < 17 ; i++)
+ for (i = 0; i < 17; i++)
setfreelist(i, 0, 0);
}
{
int i;
- for (i = 0; i < 17 ; i++)
+ for (i = 0; i < 17; i++)
if (freelist[i].first <= b && freelist[i].last >= b)
return freelist[i].last;
return 0;
printf("----- partitions -----\n"
"Pt# %*s Info Start End Sectors Id System\n",
w + 2, "Device");
- for (i = 0 ; i < partitions; i++) {
+ for (i = 0; i < partitions; i++) {
if (sgi_get_num_sectors(i) || debug ) {
uint32_t start = sgi_get_start_sector(i);
uint32_t len = sgi_get_num_sectors(i);
printf("----- Bootinfo -----\nBootfile: %s\n"
"----- Directory Entries -----\n",
sgilabel->boot_file);
- for (i = 0 ; i < sgi_volumes; i++) {
+ for (i = 0; i < sgi_volumes; i++) {
if (sgilabel->directory[i].vol_file_size) {
uint32_t start = SGI_SSWAP32(sgilabel->directory[i].vol_file_start);
uint32_t len = SGI_SSWAP32(sgilabel->directory[i].vol_file_size);
printf("%*s Flag Start End Blocks Id System\n",
w + 1, "Device");
- for (i = 0 ; i < partitions; i++) {
+ for (i = 0; i < partitions; i++) {
if (sunlabel->partitions[i].num_sectors) {
uint32_t start = SUN_SSWAP32(sunlabel->partitions[i].start_cylinder) * heads * sectors;
uint32_t len = SUN_SSWAP32(sunlabel->partitions[i].num_sectors);