summaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorManuel Novoa III2002-03-25 02:37:20 +0000
committerManuel Novoa III2002-03-25 02:37:20 +0000
commitfa15f702d2e4c7d377d6cf89e950227405622f1b (patch)
tree3dc3c890ed2bc1b14143272e556320fdeb56e091 /coreutils
parentef8b112d77c3a05f17fa108d93d44d9a66902853 (diff)
downloadbusybox-fa15f702d2e4c7d377d6cf89e950227405622f1b.zip
busybox-fa15f702d2e4c7d377d6cf89e950227405622f1b.tar.gz
Work around compiler/assembler problem and reduce code size at the same time.
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/uname.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/coreutils/uname.c b/coreutils/uname.c
index b45f4d1..df4f14e 100644
--- a/coreutils/uname.c
+++ b/coreutils/uname.c
@@ -87,7 +87,7 @@ int uname_main(int argc, char **argv)
}
#if defined(__sparc__) && defined(__linux__)
- if ((fake_sparc != NULL)
+ if ((fake_sparc != NULL)
&& ((fake_sparc[0] == 'y')
|| (fake_sparc[0] == 'Y'))) {
strcpy(uname_info.name.machine, "sparc");
@@ -96,11 +96,16 @@ int uname_main(int argc, char **argv)
strcpy(uname_info.processor, "unknown");
- for (opt=0,delta=utsname_offset ; toprint ; delta++, toprint >>= 1) {
+ delta=utsname_offset;
+ do {
if (toprint & 1) {
- printf("%s%s", (opt++==0)? "": " ", ((char *)(&uname_info)) + *delta);
+ printf(((char *)(&uname_info)) + *delta);
+ if (toprint > 1) {
+ putchar(' ');
+ }
}
- }
+ ++delta;
+ } while (toprint >>= 1);
putchar('\n');
return EXIT_SUCCESS;