svn commit: trunk/busybox: editors findutils networking networking/ etc...
vda at busybox.net
vda at busybox.net
Tue Oct 3 12:56:35 PDT 2006
Author: vda
Date: 2006-10-03 12:56:34 -0700 (Tue, 03 Oct 2006)
New Revision: 16302
Log:
lots of silly indent fixes
Modified:
trunk/busybox/editors/awk.c
trunk/busybox/editors/sed.c
trunk/busybox/editors/vi.c
trunk/busybox/findutils/grep.c
trunk/busybox/networking/httpd.c
trunk/busybox/networking/libiproute/ip_parse_common_args.c
trunk/busybox/networking/telnet.c
trunk/busybox/networking/traceroute.c
trunk/busybox/shell/cmdedit.c
trunk/busybox/util-linux/fdformat.c
trunk/busybox/util-linux/fdisk.c
trunk/busybox/util-linux/mdev.c
Changeset:
Modified: trunk/busybox/editors/awk.c
===================================================================
--- trunk/busybox/editors/awk.c 2006-10-03 19:02:20 UTC (rev 16301)
+++ trunk/busybox/editors/awk.c 2006-10-03 19:56:34 UTC (rev 16302)
@@ -1764,7 +1764,7 @@
is_numeric(arg) ? (char)getvar_i(arg) : *getvar_s(arg));
} else if (c == 's') {
- s1 = getvar_s(arg);
+ s1 = getvar_s(arg);
qrealloc(&b, incr+i+strlen(s1), &bsize);
i += sprintf(b+i, s, s1);
@@ -2434,7 +2434,7 @@
R.d--;
goto r_op_change;
case '!':
- L.d = istrue(X.v) ? 0 : 1;
+ L.d = istrue(X.v) ? 0 : 1;
break;
case '-':
L.d = -R.d;
Modified: trunk/busybox/editors/sed.c
===================================================================
--- trunk/busybox/editors/sed.c 2006-10-03 19:02:20 UTC (rev 16301)
+++ trunk/busybox/editors/sed.c 2006-10-03 19:56:34 UTC (rev 16302)
@@ -153,7 +153,7 @@
if(bbg.hold_space) free(bbg.hold_space);
- while(bbg.current_input_file<bbg.input_file_count)
+ while(bbg.current_input_file<bbg.input_file_count)
fclose(bbg.input_file_list[bbg.current_input_file++]);
}
#endif
Modified: trunk/busybox/editors/vi.c
===================================================================
--- trunk/busybox/editors/vi.c 2006-10-03 19:02:20 UTC (rev 16301)
+++ trunk/busybox/editors/vi.c 2006-10-03 19:56:34 UTC (rev 16302)
@@ -3501,8 +3501,8 @@
if (file_modified) {
#ifdef CONFIG_FEATURE_VI_READONLY
if (vi_readonly || readonly) {
- psbs("\"%s\" File is read only", cfn);
- break;
+ psbs("\"%s\" File is read only", cfn);
+ break;
}
#endif /* CONFIG_FEATURE_VI_READONLY */
cnt = file_write(cfn, text, end - 1);
Modified: trunk/busybox/findutils/grep.c
===================================================================
--- trunk/busybox/findutils/grep.c 2006-10-03 19:02:20 UTC (rev 16301)
+++ trunk/busybox/findutils/grep.c 2006-10-03 19:56:34 UTC (rev 16302)
@@ -233,7 +233,7 @@
if (PRINT_MATCH_COUNTS) {
if (print_filename > 0)
printf("%s:", cur_file);
- printf("%d\n", nmatches);
+ printf("%d\n", nmatches);
}
/* grep -l: print just the filename, but only if we grepped the line in the file */
Modified: trunk/busybox/networking/httpd.c
===================================================================
--- trunk/busybox/networking/httpd.c 2006-10-03 19:02:20 UTC (rev 16301)
+++ trunk/busybox/networking/httpd.c 2006-10-03 19:56:34 UTC (rev 16302)
@@ -325,20 +325,20 @@
i = 0;
while (*p) {
- if (*p < '0' || *p > '9') {
- if (*p == '.') {
- i = scan_ip(&ipm, mask, 0);
- return i != 32;
- }
- return -1;
+ if (*p < '0' || *p > '9') {
+ if (*p == '.') {
+ i = scan_ip(&ipm, mask, 0);
+ return i != 32;
}
- i *= 10;
- i += *p - '0';
- p++;
+ return -1;
+ }
+ i *= 10;
+ i += *p - '0';
+ p++;
}
}
if (i > 32 || i < 0)
- return -1;
+ return -1;
msk = 0x80000000;
*mask = 0;
while (i > 0) {
@@ -553,7 +553,7 @@
} else if ((cf[1] == '.') && (cf[2] == '/' || cf[2] == 0)) {
++cf;
if (p > p0) {
- while (*--p != '/'); /* omit previous dir */
+ while (*--p != '/') /* omit previous dir */;
}
continue;
}
@@ -1571,8 +1571,8 @@
/* protect out root */
goto BAD_REQUEST;
}
- while (*--purl != '/'); /* omit previous dir */
- continue;
+ while (*--purl != '/') /* omit previous dir */;
+ continue;
}
}
}
Modified: trunk/busybox/networking/libiproute/ip_parse_common_args.c
===================================================================
--- trunk/busybox/networking/libiproute/ip_parse_common_args.c 2006-10-03 19:02:20 UTC (rev 16301)
+++ trunk/busybox/networking/libiproute/ip_parse_common_args.c 2006-10-03 19:56:34 UTC (rev 16302)
@@ -48,8 +48,8 @@
if (matches(opt, "-family") == 0) {
argc--;
argv++;
- if (! argv[1])
- bb_show_usage();
+ if (!argv[1])
+ bb_show_usage();
if (strcmp(argv[1], "inet") == 0)
preferred_family = AF_INET;
else if (strcmp(argv[1], "inet6") == 0)
Modified: trunk/busybox/networking/telnet.c
===================================================================
--- trunk/busybox/networking/telnet.c 2006-10-03 19:02:20 UTC (rev 16301)
+++ trunk/busybox/networking/telnet.c 2006-10-03 19:56:34 UTC (rev 16302)
@@ -205,12 +205,12 @@
}
outbuf[j++] = *p;
if (*p == 0xff)
- outbuf[j++] = 0xff;
+ outbuf[j++] = 0xff;
else if (*p == 0x0d)
- outbuf[j++] = 0x00;
+ outbuf[j++] = 0x00;
}
if (j > 0 )
- write(G.netfd, outbuf, j);
+ write(G.netfd, outbuf, j);
}
Modified: trunk/busybox/networking/traceroute.c
===================================================================
--- trunk/busybox/networking/traceroute.c 2006-10-03 19:02:20 UTC (rev 16301)
+++ trunk/busybox/networking/traceroute.c 2006-10-03 19:56:34 UTC (rev 16302)
@@ -641,7 +641,7 @@
outicmp->icmp_cksum = 0xffff;
} else
#endif
- if (doipcksum) {
+ if (doipcksum) {
/* Checksum (we must save and restore ip header) */
tip = *outip;
ui = (struct udpiphdr *)outip;
@@ -788,7 +788,7 @@
return (type == ICMP_TIMXCEED ? -1 : code + 1);
} else
#endif
- {
+ {
up = (struct udphdr *)((unsigned char *)hip + hlen);
/* XXX 8 is a magic number */
if (hlen + 12 <= cc &&
@@ -996,11 +996,11 @@
if(nprobes_str)
nprobes = str2val(nprobes_str, "nprobes", 1, -1);
if(source) {
- /*
- * set the ip source address of the outbound
- * probe (e.g., on a multi-homed host).
- */
- if (getuid()) bb_error_msg_and_die("-s %s: Permission denied", source);
+ /*
+ * set the ip source address of the outbound
+ * probe (e.g., on a multi-homed host).
+ */
+ if (getuid()) bb_error_msg_and_die("-s %s: permission denied", source);
}
if(waittime_str)
waittime = str2val(waittime_str, "wait time", 2, 24 * 60 * 60);
@@ -1015,7 +1015,7 @@
for(l_sr = sourse_route_list; l_sr; ) {
if (lsrr >= NGATEWAYS)
- bb_error_msg_and_die("No more than %d gateways", NGATEWAYS);
+ bb_error_msg_and_die("no more than %d gateways", NGATEWAYS);
getaddr(gwlist + lsrr, l_sr->data);
++lsrr;
l_sr = l_sr->link;
Modified: trunk/busybox/shell/cmdedit.c
===================================================================
--- trunk/busybox/shell/cmdedit.c 2006-10-03 19:02:20 UTC (rev 16301)
+++ trunk/busybox/shell/cmdedit.c 2006-10-03 19:56:34 UTC (rev 16302)
@@ -271,7 +271,6 @@
if (num < 4)
while (num-- > 0)
putchar('\b');
-
else
printf("\033[%dD", num);
} else {
@@ -370,7 +369,7 @@
pbuf = buf2;
*pbuf = '~';
strcpy(pbuf+1, pwd_buf+l);
- }
+ }
break;
#endif
case 'W':
@@ -712,7 +711,7 @@
s[l++] = *found++;
}
if(add)
- s[l++] = (char)add;
+ s[l++] = (char)add;
s[l] = 0;
return s;
}
@@ -995,7 +994,7 @@
for (row = 0; row < nrows; row++) {
l = strlen(matches[row]);
if(add_char_to_match[row])
- l++;
+ l++;
if (column_width < l)
column_width = l;
}
@@ -1021,8 +1020,8 @@
printf("%s%s", matches[n], str_add_chr);
l = strlen(matches[n]);
while(l < acol) {
- putchar(' ');
- l++;
+ putchar(' ');
+ l++;
}
}
str_add_chr[0] = add_char_to_match[n];
@@ -1081,30 +1080,32 @@
int i, j, n, srt;
/* bubble */
n = num_matches;
- for(i=0; i<(n-1); i++)
- for(j=i+1; j<n; j++)
- if(matches[i]!=NULL && matches[j]!=NULL) {
- srt = strcmp(matches[i], matches[j]);
- if(srt == 0) {
- free(matches[j]);
- matches[j]=0;
- } else if(srt > 0) {
- tmp1 = matches[i];
- matches[i] = matches[j];
- matches[j] = tmp1;
- srt = add_char_to_match[i];
- add_char_to_match[i] = add_char_to_match[j];
- add_char_to_match[j] = srt;
- }
+ for(i=0; i<(n-1); i++) {
+ for(j=i+1; j<n; j++) {
+ if(matches[i]!=NULL && matches[j]!=NULL) {
+ srt = strcmp(matches[i], matches[j]);
+ if(srt == 0) {
+ free(matches[j]);
+ matches[j]=0;
+ } else if(srt > 0) {
+ tmp1 = matches[i];
+ matches[i] = matches[j];
+ matches[j] = tmp1;
+ srt = add_char_to_match[i];
+ add_char_to_match[i] = add_char_to_match[j];
+ add_char_to_match[j] = srt;
+ }
+ }
}
+ }
j = n;
n = 0;
for(i=0; i<j; i++)
- if(matches[i]) {
- matches[n]=matches[i];
- add_char_to_match[n]=add_char_to_match[i];
- n++;
- }
+ if(matches[i]) {
+ matches[n]=matches[i];
+ add_char_to_match[n]=add_char_to_match[i];
+ n++;
+ }
num_matches = n;
}
/* Did we find exactly one match? */
@@ -1623,62 +1624,62 @@
/* fall through */
case 'd'|vbit:
{
- int nc, sc;
- sc = cursor;
- prevc = ic;
- if (safe_read(0, &c, 1) < 1)
- goto prepare_to_die;
- if (c == (prevc & 0xff)) {
- /* "cc", "dd" */
- input_backward(cursor);
- goto clear_to_eol;
- break;
+ int nc, sc;
+ sc = cursor;
+ prevc = ic;
+ if (safe_read(0, &c, 1) < 1)
+ goto prepare_to_die;
+ if (c == (prevc & 0xff)) {
+ /* "cc", "dd" */
+ input_backward(cursor);
+ goto clear_to_eol;
+ break;
+ }
+ switch(c) {
+ case 'w':
+ case 'W':
+ case 'e':
+ case 'E':
+ switch (c) {
+ case 'w': /* "dw", "cw" */
+ vi_word_motion(command, vi_cmdmode);
+ break;
+ case 'W': /* 'dW', 'cW' */
+ vi_Word_motion(command, vi_cmdmode);
+ break;
+ case 'e': /* 'de', 'ce' */
+ vi_end_motion(command);
+ input_forward();
+ break;
+ case 'E': /* 'dE', 'cE' */
+ vi_End_motion(command);
+ input_forward();
+ break;
+ }
+ nc = cursor;
+ input_backward(cursor - sc);
+ while (nc-- > cursor)
+ input_delete(1);
+ break;
+ case 'b': /* "db", "cb" */
+ case 'B': /* implemented as B */
+ if (c == 'b')
+ vi_back_motion(command);
+ else
+ vi_Back_motion(command);
+ while (sc-- > cursor)
+ input_delete(1);
+ break;
+ case ' ': /* "d ", "c " */
+ input_delete(1);
+ break;
+ case '$': /* "d$", "c$" */
+ clear_to_eol:
+ while (cursor < len)
+ input_delete(1);
+ break;
+ }
}
- switch(c) {
- case 'w':
- case 'W':
- case 'e':
- case 'E':
- switch (c) {
- case 'w': /* "dw", "cw" */
- vi_word_motion(command, vi_cmdmode);
- break;
- case 'W': /* 'dW', 'cW' */
- vi_Word_motion(command, vi_cmdmode);
- break;
- case 'e': /* 'de', 'ce' */
- vi_end_motion(command);
- input_forward();
- break;
- case 'E': /* 'dE', 'cE' */
- vi_End_motion(command);
- input_forward();
- break;
- }
- nc = cursor;
- input_backward(cursor - sc);
- while (nc-- > cursor)
- input_delete(1);
- break;
- case 'b': /* "db", "cb" */
- case 'B': /* implemented as B */
- if (c == 'b')
- vi_back_motion(command);
- else
- vi_Back_motion(command);
- while (sc-- > cursor)
- input_delete(1);
- break;
- case ' ': /* "d ", "c " */
- input_delete(1);
- break;
- case '$': /* "d$", "c$" */
- clear_to_eol:
- while (cursor < len)
- input_delete(1);
- break;
- }
- }
break;
case 'p'|vbit:
input_forward();
Modified: trunk/busybox/util-linux/fdformat.c
===================================================================
--- trunk/busybox/util-linux/fdformat.c 2006-10-03 19:02:20 UTC (rev 16301)
+++ trunk/busybox/util-linux/fdformat.c 2006-10-03 19:56:34 UTC (rev 16302)
@@ -47,7 +47,7 @@
static void xioctl(int fd, int request, void *argp, const char *string)
{
- if (ioctl (fd, request, argp) < 0) {
+ if (ioctl(fd, request, argp) < 0) {
bb_perror_msg_and_die(string);
}
}
@@ -67,17 +67,16 @@
argv += optind;
/* R_OK is needed for verifying */
- if (stat(*argv,&st) < 0 || access(*argv,W_OK | R_OK ) < 0) {
- bb_perror_msg_and_die("%s",*argv);
+ if (stat(*argv, &st) < 0 || access(*argv, W_OK | R_OK ) < 0) {
+ bb_perror_msg_and_die("%s", *argv);
}
if (!S_ISBLK(st.st_mode)) {
- bb_error_msg_and_die("%s: not a block device",*argv);
+ bb_error_msg_and_die("%s: not a block device", *argv);
/* do not test major - perhaps this was an USB floppy */
}
-
/* O_RDWR for formatting and verifying */
- fd = xopen(*argv,O_RDWR );
+ fd = xopen(*argv, O_RDWR);
xioctl(fd, FDGETPRM, ¶m, "FDGETPRM");/*original message was: "Could not determine current format type" */
@@ -86,44 +85,45 @@
param.track, param.sect, param.size >> 1);
/* FORMAT */
- printf("Formatting ... ");
- xioctl(fd, FDFMTBEG,NULL,"FDFMTBEG");
+ printf("Formatting... ");
+ xioctl(fd, FDFMTBEG, NULL, "FDFMTBEG");
/* n == track */
- for (n = 0; n < param.track; n++)
- {
- descr.head = 0;
- descr.track = n;
- xioctl(fd, FDFMTTRK,&descr,"FDFMTTRK");
- printf("%3d\b\b\b", n);
- if (param.head == 2) {
- descr.head = 1;
- xioctl(fd, FDFMTTRK,&descr,"FDFMTTRK");
- }
+ for (n = 0; n < param.track; n++) {
+ descr.head = 0;
+ descr.track = n;
+ xioctl(fd, FDFMTTRK, &descr, "FDFMTTRK");
+ printf("%3d\b\b\b", n);
+ if (param.head == 2) {
+ descr.head = 1;
+ xioctl(fd, FDFMTTRK, &descr, "FDFMTTRK");
+ }
}
- xioctl(fd,FDFMTEND,NULL,"FDFMTEND");
+ xioctl(fd, FDFMTEND, NULL, "FDFMTEND");
printf("done\n");
/* VERIFY */
- if(verify) {
+ if (verify) {
/* n == cyl_size */
n = param.sect*param.head*512;
data = xmalloc(n);
- printf("Verifying ... ");
+ printf("Verifying... ");
for (cyl = 0; cyl < param.track; cyl++) {
printf("%3d\b\b\b", cyl);
- if((read_bytes = safe_read(fd,data,n))!= n ) {
- if(read_bytes < 0) {
+ read_bytes = safe_read(fd, data, n);
+ if (read_bytes != n) {
+ if (read_bytes < 0) {
bb_perror_msg(bb_msg_read_error);
}
- bb_error_msg_and_die("Problem reading cylinder %d, expected %d, read %d", cyl, n, read_bytes);
+ bb_error_msg_and_die("problem reading cylinder %d, expected %d, read %d", cyl, n, read_bytes);
+ // FIXME: maybe better seek & continue??
}
/* Check backwards so we don't need a counter */
- while(--read_bytes>=0) {
- if( data[read_bytes] != FD_FILL_BYTE) {
- printf("bad data in cyl %d\nContinuing ... ",cyl);
+ while (--read_bytes >= 0) {
+ if (data[read_bytes] != FD_FILL_BYTE) {
+ printf("bad data in cyl %d\nContinuing... ",cyl);
}
}
}
Modified: trunk/busybox/util-linux/fdisk.c
===================================================================
--- trunk/busybox/util-linux/fdisk.c 2006-10-03 19:02:20 UTC (rev 16301)
+++ trunk/busybox/util-linux/fdisk.c 2006-10-03 19:56:34 UTC (rev 16302)
@@ -4506,8 +4506,7 @@
label_sun != current_label_type && !get_nr_sects(p))
{
printf(_("Partition %d does not exist yet!\n"), i + 1);
- }else{
- while (1) {
+ } else while (1) {
sys = read_hex (get_sys_types());
if (!sys && label_sgi != current_label_type &&
@@ -4573,7 +4572,6 @@
dos_changed = 1;
break;
}
- }
}
}
#endif /* CONFIG_FEATURE_FDISK_WRITABLE */
Modified: trunk/busybox/util-linux/mdev.c
===================================================================
--- trunk/busybox/util-linux/mdev.c 2006-10-03 19:02:20 UTC (rev 16301)
+++ trunk/busybox/util-linux/mdev.c 2006-10-03 19:56:34 UTC (rev 16302)
@@ -250,7 +250,7 @@
} else {
action = getenv("ACTION");
env_path = getenv("DEVPATH");
- if (!action || !env_path)
+ if (!action || !env_path)
bb_show_usage();
sprintf(temp, "/sys%s", env_path);
More information about the busybox-cvs
mailing list