OSDN Git Service

Changes by Kazuhiro Fujieda <fujieda@jaist.ac.jp>
authorcorinna <corinna>
Sat, 1 Jul 2000 17:30:35 +0000 (17:30 +0000)
committercorinna <corinna>
Sat, 1 Jul 2000 17:30:35 +0000 (17:30 +0000)
        * assert.cc (__assert): Reduce dependency on newlib.
        * exec.cc: Eliminate unnecessary inclusion of ctype.h.
        * glob.c: Ditto.
        * hinfo.cc: Ditto.
        * init.cc: Ditto.
        * strace.cc: Ditto.
        * tty.cc: Ditto.
        * grp.cc (parse_grp): Eliminate atoi.
        * passwd.cc (grab_int): Ditto.
        * grp.cc (getgroups): Eliminate str{n,}casecmp.
        * path.cc (get_raw_device_number): Ditto.
        * path.cc (sort_by_native_name): Ditto.
        * spawn.cc (iscmd): Ditto.
        * uinfo.cc (internal_getlogin): Ditto.

13 files changed:
winsup/cygwin/ChangeLog
winsup/cygwin/assert.cc
winsup/cygwin/dtable.cc
winsup/cygwin/exec.cc
winsup/cygwin/glob.c
winsup/cygwin/grp.cc
winsup/cygwin/init.cc
winsup/cygwin/passwd.cc
winsup/cygwin/path.cc
winsup/cygwin/spawn.cc
winsup/cygwin/strace.cc
winsup/cygwin/tty.cc
winsup/cygwin/uinfo.cc

index 44bcaf5..4cacf64 100644 (file)
@@ -1,3 +1,20 @@
+2000-06-28  Kazuhiro Fujieda  <fujieda@jaist.ac.jp>
+
+       * assert.cc (__assert): Reduce dependency on newlib.
+       * exec.cc: Eliminate unnecessary inclusion of ctype.h.
+       * glob.c: Ditto.
+       * hinfo.cc: Ditto.
+       * init.cc: Ditto.
+       * strace.cc: Ditto.
+       * tty.cc: Ditto.
+       * grp.cc (parse_grp): Eliminate atoi.
+       * passwd.cc (grab_int): Ditto.
+       * grp.cc (getgroups): Eliminate str{n,}casecmp.
+       * path.cc (get_raw_device_number): Ditto.
+       * path.cc (sort_by_native_name): Ditto.
+       * spawn.cc (iscmd): Ditto.
+       * uinfo.cc (internal_getlogin): Ditto.
+
 Sat Jul  1 11:43:32 2000  Christopher Faylor <cgf@cygnus.com>
 
        * binmode.c (cygwin_premain0): Fix erroneous clearing of bit.
index 98acb6d..fd1f383 100644 (file)
@@ -32,16 +32,15 @@ __assert (const char *file, int line, const char *failedexpr)
       char *buf;
 
       buf = (char *) alloca (100 + strlen (failedexpr));
-      siprintf (buf, "Failed assertion\n\t%s\nat line %d of file %s",
+      __small_sprintf (buf, "Failed assertion\n\t%s\nat line %d of file %s",
                failedexpr, line, file);
       MessageBox (NULL, buf, NULL, MB_OK | MB_ICONERROR | MB_TASKMODAL);
     }
   else
     {
       CloseHandle (h);
-      (void) fiprintf (stderr,
-                      "assertion \"%s\" failed: file \"%s\", line %d\n",
-                      failedexpr, file, line);
+      small_printf ("assertion \"%s\" failed: file \"%s\", line %d\n",
+                   failedexpr, file, line);
     }
 
   abort ();
index dea6361..13167cc 100644 (file)
@@ -14,7 +14,6 @@ details. */
 #include <sys/socket.h>
 #include <stdlib.h>
 #include <stdio.h>
-#include <ctype.h>
 #include <unistd.h>
 #include <fcntl.h>
 
index 340e82a..b83a9b9 100644 (file)
@@ -11,7 +11,6 @@ details. */
 #include <unistd.h>
 #include <stdlib.h>
 #include <errno.h>
-#include <ctype.h>
 #include <process.h>
 #include "winsup.h"
 
index eaede49..543e4cb 100644 (file)
@@ -70,7 +70,6 @@
 #include <sys/param.h>
 #include <sys/stat.h>
 
-#include <ctype.h>
 #include <dirent.h>
 #include <errno.h>
 #include <glob.h>
index 79b1157..1d52c02 100644 (file)
@@ -66,7 +66,7 @@ parse_grp (struct group &grp, const char *line)
       if (!strlen (grp.gr_passwd))
         grp.gr_passwd = NULL;
 
-      grp.gr_gid = atoi (dp);
+      grp.gr_gid = strtol (dp, NULL, 10);
       dp = strchr (dp, ':');
       if (dp)
         {
@@ -249,7 +249,7 @@ getgroups (int gidsetsize, gid_t *grouplist, gid_t gid, const char *username)
       }
     else if (group_buf[i].gr_mem)
       for (int gi = 0; group_buf[i].gr_mem[gi]; ++gi)
-        if (! strcasecmp (username, group_buf[i].gr_mem[gi]))
+        if (strcasematch (username, group_buf[i].gr_mem[gi]))
           {
             if (cnt < gidsetsize)
               grouplist[cnt] = group_buf[i].gr_gid;
index e3809f7..5c65d55 100644 (file)
@@ -9,7 +9,6 @@ Cygwin license.  Please consult the file "CYGWIN_LICENSE" for
 details. */
 
 #include <stdlib.h>
-#include <ctype.h>
 #include "winsup.h"
 
 extern HMODULE cygwin_hmodule;
index 90a5d25..5c02f95 100644 (file)
@@ -57,7 +57,7 @@ static int
 grab_int (char **p)
 {
   char *src = *p;
-  int val = atoi (src);
+  int val = strtol (src, NULL, 10);
   while (*src && *src != ':' && *src != '\n')
     src++;
   if (*src == ':')
index 27413af..1ff1e50 100644 (file)
@@ -438,12 +438,12 @@ get_raw_device_number (const char *uxname, const char *w32path, int &unit)
 {
   DWORD devn = FH_BAD;
 
-  if (strncasecmp (w32path, "\\\\.\\tape", 8) == 0)
+  if (strncasematch (w32path, "\\\\.\\tape", 8))
     {
       devn = FH_TAPE;
       unit = digits (w32path + 8);
       // norewind tape devices have leading n in name
-      if (! strncasecmp (uxname, "/dev/n", 6))
+      if (strncasematch (uxname, "/dev/n", 6))
        unit += 128;
     }
   else if (isdrive (w32path + 4))
@@ -451,7 +451,7 @@ get_raw_device_number (const char *uxname, const char *w32path, int &unit)
       devn = FH_FLOPPY;
       unit = tolower (w32path[4]) - 'a';
     }
-  else if (strncasecmp (w32path, "\\\\.\\physicaldrive", 17) == 0)
+  else if (strncasematch (w32path, "\\\\.\\physicaldrive", 17))
     {
       devn = FH_FLOPPY;
       unit = digits (w32path + 17) + 128;
@@ -1566,7 +1566,7 @@ sort_by_native_name (const void *a, const void *b)
 
   /* The two paths were the same length, so just determine normal
      lexical sorted order. */
-  res = strcasecmp (ap->posix_path, bp->posix_path);
+  res = strcmp (ap->native_path, bp->native_path);
 
   if (res == 0)
    {
index 6ec0119..4250946 100644 (file)
@@ -169,7 +169,7 @@ iscmd (const char *argv0, const char *what)
   n = strlen (argv0) - strlen (what);
   if (n >= 2 && argv0[1] != ':')
     return 0;
-  return n >= 0 && strcasecmp (argv0 + n, what) == 0 &&
+  return n >= 0 && strcasematch (argv0 + n, what) &&
         (n == 0 || isdirsep (argv0[n - 1]));
 }
 
index bafd4e3..1fadd0d 100644 (file)
@@ -8,7 +8,6 @@ This software is a copyrighted work licensed under the terms of the
 Cygwin license.  Please consult the file "CYGWIN_LICENSE" for
 details. */
 
-#include <ctype.h>
 #include <stdlib.h>
 #include <time.h>
 #include "winsup.h"
index ec020b1..d6aecfc 100644 (file)
@@ -11,7 +11,6 @@ details. */
 #include <errno.h>
 #include <unistd.h>
 #include <utmp.h>
-#include <ctype.h>
 #include "winsup.h"
 
 extern fhandler_tty_master *tty_master;
index e2d07cc..a643d83 100644 (file)
@@ -41,7 +41,7 @@ internal_getlogin (struct pinfo *pi)
       if ((env = getenv ("USERDOMAIN")) != NULL)
         strcpy (pi->domain, env);
       /* Trust only if usernames are identical */
-      if (!strcasecmp (pi->username, buf) && pi->domain[0] && pi->logsrv[0])
+      if (strcasematch (pi->username, buf) && pi->domain[0] && pi->logsrv[0])
         debug_printf ("Domain: %s, Logon Server: %s", pi->domain, pi->logsrv);
       /* If that failed, try to get that info from NetBIOS */
       else if (!NetWkstaUserGetInfo (NULL, 1, (LPBYTE *)&wui))
@@ -53,7 +53,7 @@ internal_getlogin (struct pinfo *pi)
           wcstombs (pi->domain, wui->wkui1_logon_domain,
                     (wcslen (wui->wkui1_logon_domain) + 1) * sizeof (WCHAR));
           /* Save values in environment */
-          if (strcasecmp (pi->username, "SYSTEM")
+          if (!strcasematch (pi->username, "SYSTEM")
               && pi->domain[0] && pi->logsrv[0])
             {
               LPUSER_INFO_3 ui = NULL;
@@ -139,7 +139,7 @@ internal_getlogin (struct pinfo *pi)
               PSID psid = (PSID) psidbuf;
 
               pi->psid = (PSID) pi->sidbuf;
-              if (strcasecmp (pi->username, "SYSTEM")
+              if (!strcasematch (pi->username, "SYSTEM")
                   && pi->domain[0] && pi->logsrv[0])
                 {
                   if (get_registry_hive_path (pi->psid, buf))