HCoop
/
bpt
/
emacs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fequal_including_properties fix
[bpt/emacs.git]
/
src
/
xrdb.c
diff --git
a/src/xrdb.c
b/src/xrdb.c
index
c25c25d
..
589856d
100644
(file)
--- a/
src/xrdb.c
+++ b/
src/xrdb.c
@@
-1,5
+1,5
@@
/* Deal with the X Resource Manager.
/* Deal with the X Resource Manager.
- Copyright (C) 1990, 1993-1994, 2000-201
3
Free Software Foundation,
+ Copyright (C) 1990, 1993-1994, 2000-201
4
Free Software Foundation,
Inc.
Author: Joseph Arceneaux
Inc.
Author: Joseph Arceneaux
@@
-48,10
+48,6
@@
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "keyboard.h"
#endif
#include "keyboard.h"
#endif
-char *x_get_string_resource (XrmDatabase rdb, const char *name,
- const char *class);
-
-
\f
/* X file search path processing. */
/* X file search path processing. */
@@
-75,18
+71,9
@@
x_get_customization_string (XrmDatabase db, const char *name,
sprintf (full_class, "%s.%s", class, "Customization");
result = x_get_string_resource (db, full_name, full_class);
sprintf (full_class, "%s.%s", class, "Customization");
result = x_get_string_resource (db, full_name, full_class);
-
- if (result)
- {
- char *copy = xmalloc (strlen (result) + 1);
- strcpy (copy, result);
- return copy;
- }
- else
- return 0;
+ return result ? xstrdup (result) : NULL;
}
}
-
/* Expand all the Xt-style %-escapes in STRING, whose length is given
by STRING_LEN. Here are the escapes we're supposed to recognize:
/* Expand all the Xt-style %-escapes in STRING, whose length is given
by STRING_LEN. Here are the escapes we're supposed to recognize:
@@
-124,7
+111,7
@@
magic_db (const char *string, ptrdiff_t string_len, const char *class,
char *lang = getenv ("LANG");
ptrdiff_t path_size = 100;
char *lang = getenv ("LANG");
ptrdiff_t path_size = 100;
- char *path = xmalloc (path_size);
+ char *path = xmalloc
_atomic
(path_size);
ptrdiff_t path_len = 0;
const char *p = string;
ptrdiff_t path_len = 0;
const char *p = string;
@@
-192,7
+179,7
@@
magic_db (const char *string, ptrdiff_t string_len, const char *class,
else
next = p, next_len = 1;
else
next = p, next_len = 1;
- /* Do we have room for this component followed by a '\0'
? */
+ /* Do we have room for this component followed by a '\0'? */
if (path_size - path_len <= next_len)
{
if (min (PTRDIFF_MAX, SIZE_MAX) / 2 - 1 - path_len < next_len)
if (path_size - path_len <= next_len)
{
if (min (PTRDIFF_MAX, SIZE_MAX) / 2 - 1 - path_len < next_len)
@@
-245,11
+232,9
@@
gethomedir (void)
if (ptr == NULL)
return xstrdup ("/");
if (ptr == NULL)
return xstrdup ("/");
- copy = xmalloc (strlen (ptr) + 2);
+ copy = xmalloc
_atomic
(strlen (ptr) + 2);
strcpy (copy, ptr);
strcpy (copy, ptr);
- strcat (copy, "/");
-
- return copy;
+ return strcat (copy, "/");
}
}
@@
-370,7
+355,7
@@
get_user_db (Display *display)
char *xdefault;
home = gethomedir ();
char *xdefault;
home = gethomedir ();
- xdefault = xmalloc
(strlen (home) + sizeof ".Xdefaults"
);
+ xdefault = xmalloc
_atomic (strlen (home) + sizeof (".Xdefaults")
);
strcpy (xdefault, home);
strcat (xdefault, ".Xdefaults");
db = XrmGetFileDatabase (xdefault);
strcpy (xdefault, home);
strcat (xdefault, ".Xdefaults");
db = XrmGetFileDatabase (xdefault);
@@
-605,7
+590,7
@@
x_get_string_resource (XrmDatabase rdb, const char *name, const char *class)
if (x_get_resource (rdb, name, class, x_rm_string, &value))
return (char *) value.addr;
if (x_get_resource (rdb, name, class, x_rm_string, &value))
return (char *) value.addr;
- return
(char *)
0;
+ return 0;
}
\f
/* Stand-alone test facilities. */
}
\f
/* Stand-alone test facilities. */
@@
-634,10
+619,7
@@
member (char *elt, List list)
static void
fatal (char *msg, char *prog)
{
static void
fatal (char *msg, char *prog)
{
- if (errno)
- perror (prog);
-
- (void) fprintf (stderr, msg, prog);
+ fprintf (stderr, msg, prog);
exit (1);
}
exit (1);
}
@@
-658,10
+640,7
@@
main (int argc, char **argv)
displayname = "localhost:0.0";
lp = member ("-xrm", arg_list);
displayname = "localhost:0.0";
lp = member ("-xrm", arg_list);
- if (! NIL (lp))
- resource_string = car (cdr (lp));
- else
- resource_string = (char *) 0;
+ resource_string = NIL (lp) ? 0 : car (cdr (lp));
lp = member ("-c", arg_list);
if (! NIL (lp))
lp = member ("-c", arg_list);
if (! NIL (lp))