]> sourceware.org Git - newlib-cygwin.git/commitdiff
* cygheap.cc (cygheap_user::set_name): Avoid clearing things when just setting
authorChristopher Faylor <me@cgf.cx>
Wed, 26 Jun 2002 19:39:05 +0000 (19:39 +0000)
committerChristopher Faylor <me@cgf.cx>
Wed, 26 Jun 2002 19:39:05 +0000 (19:39 +0000)
name to itself or during first time initialization.
* environ.cc (check_case_init): Make case insensitive.

winsup/cygwin/ChangeLog
winsup/cygwin/cygheap.cc
winsup/cygwin/environ.cc

index 47ddb265c77b8be4e2c41341979d02fa8562510e..1af4606dfa2de3cc59aa44f61ac1772395dbee7a 100644 (file)
@@ -1,3 +1,10 @@
+2002-06-26  Christopher Faylor  <cgf@redhat.com>
+
+       * cygheap.cc (cygheap_user::set_name): Avoid clearing things when just
+       setting name to itself or during first time initialization.
+
+       * environ.cc (check_case_init): Make case insensitive.
+
 2002-06-26  Corinna Vinschen  <corinna@vinschen.de>
 
        * fhandler.h (fhandler_socket::bind): Add method definition.
index 0522255f6546f848aa3edae1de2b977d01501131..ded9c252a92ae198e3543461a7fdc72fe89d57ef 100644 (file)
@@ -440,9 +440,17 @@ cygheap_user::~cygheap_user ()
 void
 cygheap_user::set_name (const char *new_name)
 {
-  if (pname)
+  if (strcasematch (new_name, pname))
+    return;            /* nothing changed */
+
+  bool allocated = !!pname;
+  if (allocated)
     cfree (pname);
+
   pname = cstrdup (new_name ? new_name : "");
+  if (!allocated)
+    return;            /* Initializing.  Don't bother with other stuff. */
+
   homedrive = NULL;
   homepath = NULL;
   if (plogsrv)
index ab280265c2816de1392cd1e9f54ad86be76479fb..114fce7f032aa3703b67d63706f2aaf289e51f05 100644 (file)
@@ -411,12 +411,12 @@ check_case_init (const char *buf)
       pcheck_case = PCHECK_RELAXED;
       debug_printf ("File case checking set to RELAXED");
     }
-  else if (strcmp (buf, "adjust")== 0)
+  else if (strcasematch (buf, "adjust"))
     {
       pcheck_case = PCHECK_ADJUST;
       debug_printf ("File case checking set to ADJUST");
     }
-  else if (strcmp (buf, "strict")== 0)
+  else if (strcasematch (buf, "strict"))
     {
       pcheck_case = PCHECK_STRICT;
       debug_printf ("File case checking set to STRICT");
This page took 0.035524 seconds and 5 git commands to generate.