(setname): Do nothing when reusing the same name.
authordrepper <drepper>
Sun, 6 Jul 1997 21:39:52 +0000 (21:39 +0000)
committerdrepper <drepper>
Sun, 6 Jul 1997 21:39:52 +0000 (21:39 +0000)
locale/setlocale.c

index 0964b83..bdc65f5 100644 (file)
@@ -204,6 +204,9 @@ new_composite_name (int category, const char *newnames[LC_ALL])
 static inline void
 setname (int category, const char *name)
 {
 static inline void
 setname (int category, const char *name)
 {
+  if (_nl_current_names[category] == name)
+    return;
+
   if (_nl_current_names[category] != _nl_C_name)
     free ((void *) _nl_current_names[category]);
 
   if (_nl_current_names[category] != _nl_C_name)
     free ((void *) _nl_current_names[category]);