fix accumulated whitespace and indentation damage

This commit is contained in:
Denis Vlasenko 2007-03-20 11:30:28 +00:00
parent e84aeb5bcb
commit c86e052b81
23 changed files with 145 additions and 145 deletions

View File

@ -48,7 +48,7 @@ int id_main(int argc, char **argv)
unsigned long flags; unsigned long flags;
short status; short status;
#if ENABLE_SELINUX #if ENABLE_SELINUX
security_context_t scontext; security_context_t scontext;
#endif #endif
/* Don't allow -n -r -nr -ug -rug -nug -rnug */ /* Don't allow -n -r -nr -ug -rug -nug -rnug */
/* Don't allow more than one username */ /* Don't allow more than one username */
@ -78,25 +78,25 @@ int id_main(int argc, char **argv)
puts((flags & JUST_USER) ? bb_getpwuid(NULL, uid, -1 ) : bb_getgrgid(NULL, gid, -1 )); puts((flags & JUST_USER) ? bb_getpwuid(NULL, uid, -1 ) : bb_getgrgid(NULL, gid, -1 ));
} else { } else {
if (flags & JUST_USER) { if (flags & JUST_USER) {
printf("%u\n", uid); printf("%u\n", uid);
} }
if (flags & JUST_GROUP) { if (flags & JUST_GROUP) {
printf("%u\n", gid); printf("%u\n", gid);
} }
} }
#if ENABLE_SELINUX #if ENABLE_SELINUX
if (flags & JUST_CONTEXT) { if (flags & JUST_CONTEXT) {
selinux_or_die(); selinux_or_die();
if (argc - optind == 1) { if (argc - optind == 1) {
bb_error_msg_and_die("user name can't be passed with -Z"); bb_error_msg_and_die("user name can't be passed with -Z");
} }
if (getcon(&scontext)) { if (getcon(&scontext)) {
bb_error_msg_and_die("can't get process context"); bb_error_msg_and_die("can't get process context");
} }
printf("%s\n", scontext); printf("%s\n", scontext);
} }
#endif #endif
/* exit */ /* exit */
fflush_stdout_and_exit(EXIT_SUCCESS); fflush_stdout_and_exit(EXIT_SUCCESS);

View File

@ -518,8 +518,8 @@ int chown_main(int argc, char **argv);
int gunzip_main(int argc, char **argv); int gunzip_main(int argc, char **argv);
#endif #endif
int bbunpack(char **argv, int bbunpack(char **argv,
char* (*make_new_name)(char *filename), char* (*make_new_name)(char *filename),
USE_DESKTOP(long long) int (*unpacker)(void) USE_DESKTOP(long long) int (*unpacker)(void)
); );

View File

@ -50,36 +50,36 @@ static char *find_applet_by_name(const char *applet)
} }
static void utoa_to_buf(unsigned n, char *buf, unsigned buflen) static void utoa_to_buf(unsigned n, char *buf, unsigned buflen)
{ {
unsigned i, out, res; unsigned i, out, res;
assert(sizeof(unsigned) == 4); assert(sizeof(unsigned) == 4);
if (buflen) { if (buflen) {
out = 0; out = 0;
for (i = 1000000000; i; i /= 10) { for (i = 1000000000; i; i /= 10) {
res = n / i; res = n / i;
if (res || out || i == 1) { if (res || out || i == 1) {
if (!--buflen) break; if (!--buflen) break;
out++; out++;
n -= res*i; n -= res*i;
*buf++ = '0' + res; *buf++ = '0' + res;
} }
} }
*buf = '\0'; *buf = '\0';
} }
} }
static void itoa_to_buf(int n, char *buf, unsigned buflen) static void itoa_to_buf(int n, char *buf, unsigned buflen)
{ {
if (buflen && n<0) { if (buflen && n < 0) {
n = -n; n = -n;
*buf++ = '-'; *buf++ = '-';
buflen--; buflen--;
} }
utoa_to_buf((unsigned)n, buf, buflen); utoa_to_buf((unsigned)n, buf, buflen);
} }
static char local_buf[12]; static char local_buf[12];
static char *itoa(int n) static char *itoa(int n)
{ {
itoa_to_buf(n, local_buf, sizeof(local_buf)); itoa_to_buf(n, local_buf, sizeof(local_buf));
return local_buf; return local_buf;
} }
#else #else
# include <setjmp.h> # include <setjmp.h>