Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2003-06-13 06:36:12 +0400
committerChristopher Faylor <me@cgf.cx>2003-06-13 06:36:12 +0400
commit6806f4f6e28562271e14c503a945c1625337240e (patch)
tree5f4129221fc6aa436a0e6d37a27b18598615e8bd /winsup/utils
parent8d60a6029c1b4cd28b7ede9263705a9c026e6d6f (diff)
* cygcheck.cc (pretty_id): Rework slightly to not rely on spaces.
Diffstat (limited to 'winsup/utils')
-rw-r--r--winsup/utils/ChangeLog4
-rw-r--r--winsup/utils/cygcheck.cc14
2 files changed, 11 insertions, 7 deletions
diff --git a/winsup/utils/ChangeLog b/winsup/utils/ChangeLog
index 63277c900..2aac863b2 100644
--- a/winsup/utils/ChangeLog
+++ b/winsup/utils/ChangeLog
@@ -1,5 +1,9 @@
2003-06-12 Christopher Faylor <cgf@redhat.com>
+ * cygcheck.cc (pretty_id): Rework slightly to not rely on spaces.
+
+2003-06-12 Christopher Faylor <cgf@redhat.com>
+
* cygpath.cc: Throughout, always return error when GetShortPathName
returns 0.
diff --git a/winsup/utils/cygcheck.cc b/winsup/utils/cygcheck.cc
index 34522d50d..a6b0f4d1c 100644
--- a/winsup/utils/cygcheck.cc
+++ b/winsup/utils/cygcheck.cc
@@ -784,8 +784,8 @@ pretty_id (const char *s, char *cygwin, size_t cyglen)
char buf[16384];
fgets (buf, sizeof (buf), f);
- char *uid = strtok (buf, " ") + sizeof ("uid=") - 1;
- char *gid = strtok (NULL, " ") + sizeof ("gid=") - 1;
+ char *uid = strtok (buf, ")") + strlen ("uid=");
+ char *gid = strtok (NULL, ")") + strlen ("gid=") + 1;
char **ng;
size_t sz = 0;
for (ng = groups; (*ng = strtok (NULL, ",")); ng++)
@@ -794,21 +794,21 @@ pretty_id (const char *s, char *cygwin, size_t cyglen)
if (p)
*p = '\0';
if (ng == groups)
- *ng += sizeof ("groups=") - 1;
+ *ng += strlen (" groups=");
size_t len = strlen (*ng);
if (sz < len)
sz = len;
}
- printf ("\n%s output (%s)\n", id, s);
- int szmaybe = sizeof ("UID: ") + strlen (uid) - 1;
+ printf ("\nOutput from %s (%s)\n", id, s);
+ int szmaybe = strlen ("UID: ") + strlen (uid);
if (sz < szmaybe)
sz = szmaybe;
sz += 1;
int n = 80 / (int) sz;
sz = -sz;
- ng[0] += sizeof ("groups=") - 1;
- printf ("UID: %*s GID: %s\n", sz + (sizeof ("UID: ") - 1), uid, gid);
+ ng[0] += strlen ("groups=");
+ printf ("UID: %.*s) GID: %s)\n", sz + (sizeof ("UID: ") - 1), uid, gid);
int i = 0;
for (char **g = groups; g < ng; g++)
{