]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Mirror 1.1.x changes.
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Mon, 25 Aug 2003 16:08:44 +0000 (16:08 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Mon, 25 Aug 2003 16:08:44 +0000 (16:08 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/branches/branch-1.2@3881 7a7537e8-13f0-0310-91df-b6672ffda945

cups/language.c

index b39aa86eea026c1532f166fbc48d42be1a121136..984df59ee5fe1f1f4c38c9001a45b6f4cbc2ab34 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: language.c,v 1.20.2.24 2003/07/20 12:51:40 mike Exp $"
+ * "$Id: language.c,v 1.20.2.25 2003/08/25 16:08:44 mike Exp $"
  *
  *   I18N/language support for the Common UNIX Printing System (CUPS).
  *
@@ -675,10 +675,26 @@ _cupsSaveLocale(int        category,      /* I - Category */
   DEBUG_printf(("_cupsSaveLocale(category=%d, locale=\"%s\")\n",
                 category, locale));
 
-  if ((oldlocale = setlocale(category, locale)) != NULL)
-    return (strdup(oldlocale));
-  else
-    return (NULL);
+ /*
+  * Get the old locale and copy it...
+  */
+
+  if ((oldlocale = setlocale(category, NULL)) != NULL)
+    oldlocale = strdup(oldlocale);
+
+  DEBUG_printf(("    oldlocale=\"%s\"\n", oldlocale ? oldlocale : "(null)"));
+
+ /*
+  * Set the new locale...
+  */
+
+  setlocale(category, locale);
+
+ /*
+  * Return a copy of the old locale...
+  */
+
+  return (oldlocale);
 }
 
 
@@ -866,5 +882,5 @@ cups_cache_lookup(const char      *name,/* I - Name of locale */
 
 
 /*
- * End of "$Id: language.c,v 1.20.2.24 2003/07/20 12:51:40 mike Exp $".
+ * End of "$Id: language.c,v 1.20.2.25 2003/08/25 16:08:44 mike Exp $".
  */