summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1993-11-15 14:32:17 +0000
committerJim Meyering <jim@meyering.net>1993-11-15 14:32:17 +0000
commit4bce07bc255df2556f53dda05394025c9e712e2b (patch)
tree16bb2ef1ab210331f597dd43249535b902aefaba /src
parent39fd5971dd6fcb6e93db4e33cfa6bedbc4dd8610 (diff)
downloadcoreutils-4bce07bc255df2556f53dda05394025c9e712e2b.tar.xz
merge with 1.9a
Diffstat (limited to 'src')
-rw-r--r--src/id.c1
-rw-r--r--src/stty.c6
-rw-r--r--src/who.c14
3 files changed, 17 insertions, 4 deletions
diff --git a/src/id.c b/src/id.c
index a43921b93..e5d12d16c 100644
--- a/src/id.c
+++ b/src/id.c
@@ -42,6 +42,7 @@
#ifdef _POSIX_VERSION
#include <limits.h>
#if !defined(NGROUPS_MAX) || NGROUPS_MAX < 1
+#undef NGROUPS_MAX
#define NGROUPS_MAX sysconf (_SC_NGROUPS_MAX)
#endif /* !NGROUPS_MAX */
diff --git a/src/stty.c b/src/stty.c
index 07307ff37..60f2ec9f1 100644
--- a/src/stty.c
+++ b/src/stty.c
@@ -118,12 +118,12 @@
#if defined(VLNEXT) && !defined(CLNEXT)
#define CLNEXT Control ('v')
#endif
-#if defined(VFLUSHO) && !defined(CFLUSHO)
-#define CFLUSHO Control ('o')
-#endif
#if defined(VDISCARD) && !defined(VFLUSHO)
#define VFLUSHO VDISCARD
#endif
+#if defined(VFLUSHO) && !defined(CFLUSHO)
+#define CFLUSHO Control ('o')
+#endif
#if defined(VSTATUS) && !defined(CSTATUS)
#define CSTATUS Control ('t')
#endif
diff --git a/src/who.c b/src/who.c
index f01da1b09..331937e08 100644
--- a/src/who.c
+++ b/src/who.c
@@ -327,7 +327,19 @@ list_entries (n)
#endif
)
{
- printf ("%s ", this->ut_name);
+ char trimmed_name[sizeof (this->ut_name) + 1];
+ int i;
+
+ strncpy (trimmed_name, this->ut_name, sizeof (this->ut_name));
+ trimmed_name[sizeof (this->ut_name)] = ' ';
+ for (i = 0; i <= sizeof (this->ut_name); i++)
+ {
+ if (trimmed_name[i] == ' ')
+ break;
+ }
+ trimmed_name[i] = '\0';
+
+ printf ("%s ", trimmed_name);
entries++;
}
this++;