summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJuanma Barranquero <lekktu@gmail.com>2003-03-06 13:00:04 +0000
committerJuanma Barranquero <lekktu@gmail.com>2003-03-06 13:00:04 +0000
commitc13a8a91d70ee03182bf0a4deb47a58749680606 (patch)
treefe57ed5eb1c1ecf8e31592f1d8b88f8ec6dcdc83 /src
parent7114765394405bc9f6a7af47691e9c8048c2665e (diff)
downloademacs-c13a8a91d70ee03182bf0a4deb47a58749680606.tar.gz
(w32_make_rdb): New function.
(w32_term_init): Use it to initialize xrdb member of w32_display_info struct. Delete leftover code.
Diffstat (limited to 'src')
-rw-r--r--src/w32term.c70
1 files changed, 57 insertions, 13 deletions
diff --git a/src/w32term.c b/src/w32term.c
index 23929905334..c74eb90cdfc 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -11134,6 +11134,61 @@ w32_initialize_display_info (display_name)
}
+/* Create an xrdb-style database of resources to supercede registry settings.
+ The database is just a concatenation of C strings, finished by an additional
+ \0. The string are submitted to some basic normalization, so
+
+ [ *]option[ *]:[ *]value...
+
+ becomes
+
+ option:value...
+
+ but any whitespace following value is not removed. */
+
+static char *
+w32_make_rdb (xrm_option)
+ char *xrm_option;
+{
+ char *buffer = xmalloc (strlen (xrm_option) + 2);
+ char *current = buffer;
+ char ch;
+ int in_option = 1;
+ int before_value = 0;
+
+ do {
+ ch = *xrm_option++;
+
+ if (ch == '\n')
+ {
+ *current++ = '\0';
+ in_option = 1;
+ before_value = 0;
+ }
+ else if (ch != ' ')
+ {
+ *current++ = ch;
+ if (in_option && (ch == ':'))
+ {
+ in_option = 0;
+ before_value = 1;
+ }
+ else if (before_value)
+ {
+ before_value = 0;
+ }
+ }
+ else if (!(in_option || before_value))
+ {
+ *current++ = ch;
+ }
+ } while (ch);
+
+ *current = '\0';
+
+ return buffer;
+}
+
struct w32_display_info *
w32_term_init (display_name, xrm_option, resource_name)
Lisp_Object display_name;
@@ -11151,23 +11206,12 @@ w32_term_init (display_name, xrm_option, resource_name)
w32_initialized = 1;
}
- {
- int argc = 0;
- char *argv[3];
-
- argv[0] = "";
- argc = 1;
- if (xrm_option)
- {
- argv[argc++] = "-xrm";
- argv[argc++] = xrm_option;
- }
- }
-
w32_initialize_display_info (display_name);
dpyinfo = &one_w32_display_info;
+ dpyinfo->xrdb = xrm_option ? w32_make_rdb (xrm_option) : NULL;
+
/* Put this display on the chain. */
dpyinfo->next = x_display_list;
x_display_list = dpyinfo;