/* Deal with the X Resource Manager.
- Copyright (C) 1990, 1993-1994, 2000-2014 Free Software Foundation,
+ Copyright (C) 1990, 1993-1994, 2000-2015 Free Software Foundation,
Inc.
Author: Joseph Arceneaux
while (p < string + string_len)
{
/* The chunk we're about to stick on the end of result. */
- const char *next = NULL;
- ptrdiff_t next_len;
+ const char *next = p;
+ ptrdiff_t next_len = 1;
if (*p == '%')
{
break;
case 'C':
- next = (x_customization_string
- ? x_customization_string
- : "");
- next_len = strlen (next);
+ if (x_customization_string)
+ {
+ next = x_customization_string;
+ next_len = strlen (next);
+ }
+ else
+ next_len = 0;
break;
case 'N':
return NULL;
}
}
- else
- next = p, next_len = 1;
/* Do we have room for this component followed by a '\0'? */
if (path_size - path_len <= next_len)
{
char *home = gethomedir ();
ptrdiff_t homelen = strlen (home);
+ Lisp_Object system_name = Fsystem_name ();
ptrdiff_t filenamesize = (homelen + sizeof xdefaults
- + SBYTES (Vsystem_name));
+ + SBYTES (system_name));
p = filename = xrealloc (home, filenamesize);
- lispstpcpy (stpcpy (filename + homelen, xdefaults), Vsystem_name);
+ lispstpcpy (stpcpy (filename + homelen, xdefaults), system_name);
}
db = XrmGetFileDatabase (p);
/* In a real program, you'd want to also do this: */
display->db = xdb;
- while (1)
+ while (true)
{
char query_name[90];
char query_class[90];