# HG changeset patch # User Juanma Barranquero # Date 1046955887 0 # Node ID 57e262ca5d0d8671cb5368bc4eb06c9d3530f183 # Parent 479f0fd3607c70dabc56f09348320040b6a9c658 (w32_get_rdb_resource): New function. (x_get_string_resource): Use it, so resources passed with -xrm supercede the ones in the registry. diff -r 479f0fd3607c -r 57e262ca5d0d src/w32reg.c --- a/src/w32reg.c Thu Mar 06 13:01:32 2003 +0000 +++ b/src/w32reg.c Thu Mar 06 13:04:47 2003 +0000 @@ -30,6 +30,26 @@ #define REG_ROOT "SOFTWARE\\GNU\\Emacs" +static char * +w32_get_rdb_resource (rdb, resource) + char *rdb; + char *resource; +{ + char *value = rdb; + int len = strlen (resource); + + while (*value) + { + /* Comparison is case-insensitive because registry searches are too. */ + if ((strnicmp (value, resource, len) == 0) && (value[len] == ':')) + return xstrdup (&value[len + 1]); + + value = strchr (value, '\0') + 1; + } + + return NULL; +} + LPBYTE w32_get_string_resource (name, class, dwexptype) char *name, *class; @@ -99,8 +119,18 @@ char * x_get_string_resource (rdb, name, class) - int rdb; + char *rdb; char *name, *class; { + if (rdb) + { + char *resource; + + if (resource = w32_get_rdb_resource (rdb, name)) + return resource; + if (resource = w32_get_rdb_resource (rdb, class)) + return resource; + } + return (w32_get_string_resource (name, class, REG_SZ)); }