+/*
+ * CDE - Common Desktop Environment
+ *
+ * Copyright (c) 1993-2012, The Open Group. All rights reserved.
+ *
+ * These libraries and programs are free software; you can
+ * redistribute them and/or modify them under the terms of the GNU
+ * Lesser General Public License as published by the Free Software
+ * Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ *
+ * These libraries and programs are distributed in the hope that
+ * they will be useful, but WITHOUT ANY WARRANTY; without even the
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with these libraries and programs; if not, write
+ * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
+ * Floor, Boston, MA 02110-1301 USA
+ */
/* $TOG: Helpos.c /main/13 1998/07/30 12:08:32 mgreess $ */
/************************************<+>*************************************
****************************************************************************
if (catFile == NULL)
{
/* Setup the short and long versions */
-#ifdef __ultrix
- CatFileName = strdup("DtHelp.cat");
-#else
CatFileName = strdup("DtHelp");
-#endif
}
else
- {
-#ifdef __ultrix
-
- /* If we have a full path, just use it */
- if (*catFile == '/')
- CatFileName = strdup(catFile);
- else
- {
- /* We don't have a full path, and the ultirx os needs the
- * ".cat" extention so let's make sure its there.
- */
- if (strcmp(&catFile[strlen(catFile) -4], ".cat") == 0)
- CatFileName = strdup(catFile);
- else
- {
- /* Create our CatFileName with the extention */
- CatFileName = malloc (strlen(catFile) + 5);
- /* +5, 1 for NULL, 4 for ".cat" */
- strcpy(CatFileName, catFile);
- strcat(CatFileName, ".cat");
- }
- }
-
-
-#else
+ {
/* If we have a full path, just use it */
if (*catFile == '/')
/* hp-ux os does not work with the ".cat" extention, so
* if one exists, remove it.
*/
-
+
if (strcmp(&catFile[strlen(catFile) -4], ".cat") != 0)
CatFileName = strdup(catFile);
else
CatFileName[len]= '\0';
}
}
-#endif
}
_DtHelpProcessUnlock();
}
static nl_catd nlmsg_fd;
_DtHelpProcessLock();
- if ( first )
+ if ( first )
{
/* Setup our default message catalog names if none have been set! */
if (CatFileName == NULL)
{
/* Setup the short and long versions */
-#ifdef __ultrix
- CatFileName = strdup("DtHelp.cat");
-#else
CatFileName = strdup("DtHelp");
-#endif
}
-
+
loc = _DtHelpGetLocale();
- if (!loc || !(strcmp (loc, "C")))
+ if (!loc || !(strcmp (loc, "C")))
/*
* If LANG is not set or if LANG=C, then there
* is no need to open the message catalog - just
* If that is NULL, returns NULL.
*
*****************************************************************************/
-char *_DtHelpGetLocale()
+char *_DtHelpGetLocale(void)
{
char *loc;