rpc.cmsd: use TIRPC on Linux
[oweals/cde.git] / cde / programs / dtlogin / resource.c
index 2c4e62ffa023e88f3e81b0094fd20095d4731078..6608dba540c99776a690642cb982bc21c5fcc90a 100644 (file)
@@ -16,7 +16,7 @@
  * details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with these librararies and programs; if not, write
+ * 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
  */
@@ -90,9 +90,6 @@ int   langListTimeout;
 #ifdef DEF_NETWORK_DEV
 char    *networkDev;
 #endif
-#if defined(__osf__)
-char   *ignoreLocales;
-#endif
 
 /*
  * Dtlogin will accept both Dtlogin and XDM resources. The string variable
@@ -222,12 +219,6 @@ static     char    AppName[16] = DTLOGIN;
 #  ifdef __apollo
 #    define DEF_LANG   "C"
 #  endif
-#  ifdef __osf__
-#    define DEF_LANG    "C"
-#  endif
-#  ifdef __hp_osf
-#    define DEF_LANG   "en_US.88591"
-#  endif
 #  ifdef sun   /* default language under Solaris */
 #    define DEF_LANG    "C" 
 #  endif
@@ -290,10 +281,6 @@ struct dmResources {
 "networkDevice","NetworkDevice",DM_STRING,      &networkDev,
                                 DEF_NETWORK_DEV,
 #endif
-#if defined(__osf__)
-"ignoreLocales", "IgnoreLocales", DM_STRING,    &ignoreLocales,
-                               "",
-#endif
 };
 
 # define NUM_DM_RESOURCES      (sizeof DmResources / sizeof DmResources[0])
@@ -409,6 +396,7 @@ GetResource( char *name, char *class, int valueType, char **valuep,
     char       *type;
     XrmValue   value;
     char       *string, *new_string;
+    char       empty[] = "";
     char       str_buf[50];
     int        len;
 
@@ -422,8 +410,13 @@ GetResource( char *name, char *class, int valueType, char **valuep,
     }
     else
     {
-       string = default_value;
-       len = (string == NULL ? 0 : strlen (string));
+       if(default_value) {
+               string = default_value;
+               len = strlen (string);
+       } else {
+               string = empty;
+               len = 0;
+       }
     }
 
     Debug ("%s/%s value %*.*s\n", name, class, len, len, string);
@@ -435,7 +428,7 @@ GetResource( char *name, char *class, int valueType, char **valuep,
      
      if (valueType == DM_STRING && *valuep) {
        if (string != NULL && strlen (*valuep) == len && !strncmp (*valuep, string, len))
-           return;
+           return 0;
        else {
            free (*valuep);
            *(valuep) = NULL;
@@ -450,7 +443,7 @@ GetResource( char *name, char *class, int valueType, char **valuep,
            if (!new_string) {
                LogOutOfMem(
                  ReadCatalog(MC_LOG_SET,MC_LOG_GET_RSC,MC_DEF_LOG_GET_RSC));
-               return;
+               return 0;
            }
            strncpy (new_string, string, len);
            new_string[len] = '\0';
@@ -480,6 +473,8 @@ GetResource( char *name, char *class, int valueType, char **valuep,
         break;
 
     }
+
+    return 1;
 }
 
 XrmOptionDescRec configTable [] = {
@@ -863,9 +858,14 @@ char * newname;
                     strncpy(newname, tempName, tempLen);
                     strcpy(newname+tempLen, name);
                     free (langString);
+                    free (tempName);
                     return(newname);
                 }
             }
+
+        default:
+          /* special is of an unknown value */
+          return(NULL);
     }
 }