diff options
-rw-r--r-- | coreutils/uname.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/coreutils/uname.c b/coreutils/uname.c index b45f4d156..df4f14ea0 100644 --- a/coreutils/uname.c +++ b/coreutils/uname.c | |||
@@ -87,7 +87,7 @@ int uname_main(int argc, char **argv) | |||
87 | } | 87 | } |
88 | 88 | ||
89 | #if defined(__sparc__) && defined(__linux__) | 89 | #if defined(__sparc__) && defined(__linux__) |
90 | if ((fake_sparc != NULL) | 90 | if ((fake_sparc != NULL) |
91 | && ((fake_sparc[0] == 'y') | 91 | && ((fake_sparc[0] == 'y') |
92 | || (fake_sparc[0] == 'Y'))) { | 92 | || (fake_sparc[0] == 'Y'))) { |
93 | strcpy(uname_info.name.machine, "sparc"); | 93 | strcpy(uname_info.name.machine, "sparc"); |
@@ -96,11 +96,16 @@ int uname_main(int argc, char **argv) | |||
96 | 96 | ||
97 | strcpy(uname_info.processor, "unknown"); | 97 | strcpy(uname_info.processor, "unknown"); |
98 | 98 | ||
99 | for (opt=0,delta=utsname_offset ; toprint ; delta++, toprint >>= 1) { | 99 | delta=utsname_offset; |
100 | do { | ||
100 | if (toprint & 1) { | 101 | if (toprint & 1) { |
101 | printf("%s%s", (opt++==0)? "": " ", ((char *)(&uname_info)) + *delta); | 102 | printf(((char *)(&uname_info)) + *delta); |
103 | if (toprint > 1) { | ||
104 | putchar(' '); | ||
105 | } | ||
102 | } | 106 | } |
103 | } | 107 | ++delta; |
108 | } while (toprint >>= 1); | ||
104 | putchar('\n'); | 109 | putchar('\n'); |
105 | 110 | ||
106 | return EXIT_SUCCESS; | 111 | return EXIT_SUCCESS; |