Work around compiler/assembler problem and reduce code size at the same time.
authorManuel Novoa III <mjn3@codepoet.org>
Mon, 25 Mar 2002 02:37:20 +0000 (02:37 -0000)
committerManuel Novoa III <mjn3@codepoet.org>
Mon, 25 Mar 2002 02:37:20 +0000 (02:37 -0000)
coreutils/uname.c

index b45f4d1562d575780309d3b42944238d478411fc..df4f14ea0577f41b929c539e798e57af05d92518 100644 (file)
@@ -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;