fix accumulated whitespace and indentation damage
This commit is contained in:
parent
e84aeb5bcb
commit
c86e052b81
@ -48,7 +48,7 @@ int id_main(int argc, char **argv)
|
||||
unsigned long flags;
|
||||
short status;
|
||||
#if ENABLE_SELINUX
|
||||
security_context_t scontext;
|
||||
security_context_t scontext;
|
||||
#endif
|
||||
/* Don't allow -n -r -nr -ug -rug -nug -rnug */
|
||||
/* 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 ));
|
||||
} else {
|
||||
if (flags & JUST_USER) {
|
||||
printf("%u\n", uid);
|
||||
}
|
||||
if (flags & JUST_GROUP) {
|
||||
printf("%u\n", gid);
|
||||
}
|
||||
}
|
||||
printf("%u\n", uid);
|
||||
}
|
||||
if (flags & JUST_GROUP) {
|
||||
printf("%u\n", gid);
|
||||
}
|
||||
}
|
||||
|
||||
#if ENABLE_SELINUX
|
||||
if (flags & JUST_CONTEXT) {
|
||||
if (flags & JUST_CONTEXT) {
|
||||
selinux_or_die();
|
||||
if (argc - optind == 1) {
|
||||
bb_error_msg_and_die("user name can't be passed with -Z");
|
||||
}
|
||||
if (argc - optind == 1) {
|
||||
bb_error_msg_and_die("user name can't be passed with -Z");
|
||||
}
|
||||
|
||||
if (getcon(&scontext)) {
|
||||
bb_error_msg_and_die("can't get process context");
|
||||
}
|
||||
printf("%s\n", scontext);
|
||||
}
|
||||
if (getcon(&scontext)) {
|
||||
bb_error_msg_and_die("can't get process context");
|
||||
}
|
||||
printf("%s\n", scontext);
|
||||
}
|
||||
#endif
|
||||
/* exit */
|
||||
fflush_stdout_and_exit(EXIT_SUCCESS);
|
||||
|
@ -518,8 +518,8 @@ int chown_main(int argc, char **argv);
|
||||
int gunzip_main(int argc, char **argv);
|
||||
#endif
|
||||
int bbunpack(char **argv,
|
||||
char* (*make_new_name)(char *filename),
|
||||
USE_DESKTOP(long long) int (*unpacker)(void)
|
||||
char* (*make_new_name)(char *filename),
|
||||
USE_DESKTOP(long long) int (*unpacker)(void)
|
||||
);
|
||||
|
||||
|
||||
|
46
shell/msh.c
46
shell/msh.c
@ -50,36 +50,36 @@ static char *find_applet_by_name(const char *applet)
|
||||
}
|
||||
static void utoa_to_buf(unsigned n, char *buf, unsigned buflen)
|
||||
{
|
||||
unsigned i, out, res;
|
||||
assert(sizeof(unsigned) == 4);
|
||||
if (buflen) {
|
||||
out = 0;
|
||||
for (i = 1000000000; i; i /= 10) {
|
||||
res = n / i;
|
||||
if (res || out || i == 1) {
|
||||
if (!--buflen) break;
|
||||
out++;
|
||||
n -= res*i;
|
||||
*buf++ = '0' + res;
|
||||
}
|
||||
}
|
||||
*buf = '\0';
|
||||
}
|
||||
unsigned i, out, res;
|
||||
assert(sizeof(unsigned) == 4);
|
||||
if (buflen) {
|
||||
out = 0;
|
||||
for (i = 1000000000; i; i /= 10) {
|
||||
res = n / i;
|
||||
if (res || out || i == 1) {
|
||||
if (!--buflen) break;
|
||||
out++;
|
||||
n -= res*i;
|
||||
*buf++ = '0' + res;
|
||||
}
|
||||
}
|
||||
*buf = '\0';
|
||||
}
|
||||
}
|
||||
static void itoa_to_buf(int n, char *buf, unsigned buflen)
|
||||
{
|
||||
if (buflen && n<0) {
|
||||
n = -n;
|
||||
*buf++ = '-';
|
||||
buflen--;
|
||||
}
|
||||
utoa_to_buf((unsigned)n, buf, buflen);
|
||||
if (buflen && n < 0) {
|
||||
n = -n;
|
||||
*buf++ = '-';
|
||||
buflen--;
|
||||
}
|
||||
utoa_to_buf((unsigned)n, buf, buflen);
|
||||
}
|
||||
static char local_buf[12];
|
||||
static char *itoa(int n)
|
||||
{
|
||||
itoa_to_buf(n, local_buf, sizeof(local_buf));
|
||||
return local_buf;
|
||||
itoa_to_buf(n, local_buf, sizeof(local_buf));
|
||||
return local_buf;
|
||||
}
|
||||
#else
|
||||
# include <setjmp.h>
|
||||
|
Loading…
Reference in New Issue
Block a user