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>2002-06-26 23:39:05 +0400
committerChristopher Faylor <me@cgf.cx>2002-06-26 23:39:05 +0400
commitc99902b9b09c43722eeccac40175f9e69d9e59c4 (patch)
treef54598c586a7cba3597891fae24dc6a3769f3059 /winsup/cygwin/cygheap.cc
parentbe5007aa5299be3acfe2ac63236fce319bb96bb1 (diff)
* 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.
Diffstat (limited to 'winsup/cygwin/cygheap.cc')
-rw-r--r--winsup/cygwin/cygheap.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/winsup/cygwin/cygheap.cc b/winsup/cygwin/cygheap.cc
index 0522255f6..ded9c252a 100644
--- a/winsup/cygwin/cygheap.cc
+++ b/winsup/cygwin/cygheap.cc
@@ -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)