OSDN Git Service

* cygheap.cc (cygheap_user::set_name): Allow to change the user name
authorcorinna <corinna>
Mon, 31 May 2010 18:52:01 +0000 (18:52 +0000)
committercorinna <corinna>
Mon, 31 May 2010 18:52:01 +0000 (18:52 +0000)
if it only differs by case.

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

index 2db4407..66e91c4 100644 (file)
@@ -1,3 +1,8 @@
+2010-05-31  Corinna Vinschen  <corinna@vinschen.de>
+
+       * cygheap.cc (cygheap_user::set_name): Allow to change the user name
+       if it only differs by case.
+
 2010-05-26  Corinna Vinschen  <corinna@vinschen.de>
 
        * fhandler_registry.cc (multi_wcstombs): New function.
index 6cbdda9..623fd76 100644 (file)
@@ -446,7 +446,9 @@ cygheap_user::set_name (const char *new_name)
 
   if (allocated)
     {
-      if (strcasematch (new_name, pname))
+      /* Windows user names are case-insensitive.  Here we want the correct
+         username, though, even if it only differs by case. */
+      if (!strcmp (new_name, pname))
        return;
       cfree (pname);
     }