diff options
-rw-r--r-- | winsup/cygwin/ChangeLog | 17 | ||||
-rw-r--r-- | winsup/cygwin/assert.cc | 7 | ||||
-rw-r--r-- | winsup/cygwin/dtable.cc | 1 | ||||
-rw-r--r-- | winsup/cygwin/exec.cc | 1 | ||||
-rw-r--r-- | winsup/cygwin/glob.c | 1 | ||||
-rw-r--r-- | winsup/cygwin/grp.cc | 4 | ||||
-rw-r--r-- | winsup/cygwin/init.cc | 1 | ||||
-rw-r--r-- | winsup/cygwin/passwd.cc | 2 | ||||
-rw-r--r-- | winsup/cygwin/path.cc | 8 | ||||
-rw-r--r-- | winsup/cygwin/spawn.cc | 2 | ||||
-rw-r--r-- | winsup/cygwin/strace.cc | 1 | ||||
-rw-r--r-- | winsup/cygwin/tty.cc | 1 | ||||
-rw-r--r-- | winsup/cygwin/uinfo.cc | 6 |
13 files changed, 31 insertions, 21 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 44bcaf5..4cacf64 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -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. diff --git a/winsup/cygwin/assert.cc b/winsup/cygwin/assert.cc index 98acb6d..fd1f383 100644 --- a/winsup/cygwin/assert.cc +++ b/winsup/cygwin/assert.cc @@ -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 (); diff --git a/winsup/cygwin/dtable.cc b/winsup/cygwin/dtable.cc index dea6361..13167cc 100644 --- a/winsup/cygwin/dtable.cc +++ b/winsup/cygwin/dtable.cc @@ -14,7 +14,6 @@ details. */ #include <sys/socket.h> #include <stdlib.h> #include <stdio.h> -#include <ctype.h> #include <unistd.h> #include <fcntl.h> diff --git a/winsup/cygwin/exec.cc b/winsup/cygwin/exec.cc index 340e82a..b83a9b9 100644 --- a/winsup/cygwin/exec.cc +++ b/winsup/cygwin/exec.cc @@ -11,7 +11,6 @@ details. */ #include <unistd.h> #include <stdlib.h> #include <errno.h> -#include <ctype.h> #include <process.h> #include "winsup.h" diff --git a/winsup/cygwin/glob.c b/winsup/cygwin/glob.c index eaede49..543e4cb 100644 --- a/winsup/cygwin/glob.c +++ b/winsup/cygwin/glob.c @@ -70,7 +70,6 @@ #include <sys/param.h> #include <sys/stat.h> -#include <ctype.h> #include <dirent.h> #include <errno.h> #include <glob.h> diff --git a/winsup/cygwin/grp.cc b/winsup/cygwin/grp.cc index 79b1157..1d52c02 100644 --- a/winsup/cygwin/grp.cc +++ b/winsup/cygwin/grp.cc @@ -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; diff --git a/winsup/cygwin/init.cc b/winsup/cygwin/init.cc index e3809f7..5c65d55 100644 --- a/winsup/cygwin/init.cc +++ b/winsup/cygwin/init.cc @@ -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; diff --git a/winsup/cygwin/passwd.cc b/winsup/cygwin/passwd.cc index 90a5d25..5c02f95 100644 --- a/winsup/cygwin/passwd.cc +++ b/winsup/cygwin/passwd.cc @@ -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 == ':') diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index 27413af..1ff1e50 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -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) { diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc index 6ec0119..4250946 100644 --- a/winsup/cygwin/spawn.cc +++ b/winsup/cygwin/spawn.cc @@ -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])); } diff --git a/winsup/cygwin/strace.cc b/winsup/cygwin/strace.cc index bafd4e3..1fadd0d 100644 --- a/winsup/cygwin/strace.cc +++ b/winsup/cygwin/strace.cc @@ -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" diff --git a/winsup/cygwin/tty.cc b/winsup/cygwin/tty.cc index ec020b1..d6aecfc 100644 --- a/winsup/cygwin/tty.cc +++ b/winsup/cygwin/tty.cc @@ -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; diff --git a/winsup/cygwin/uinfo.cc b/winsup/cygwin/uinfo.cc index e2d07cc..a643d83 100644 --- a/winsup/cygwin/uinfo.cc +++ b/winsup/cygwin/uinfo.cc @@ -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)) |