/*
- * "$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).
*
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);
}
/*
- * 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 $".
*/