(Lisp_Object value, Lisp_Object frame)
{
struct frame *f = decode_window_system_frame (frame);
- char *name = 0;
- char empty[] = "";
- Lisp_Object ret = Qnil;
Display *dpy = FRAME_X_DISPLAY (f);
struct x_display_info *dpyinfo;
Atom atom;
block_input ();
x_catch_errors (dpy);
- name = (atom ? x_get_atom_name (dpyinfo, atom,
- &need_sync) : empty);
+ char *name = atom ? x_get_atom_name (dpyinfo, atom, &need_sync) : NULL;
had_errors_p = need_sync && x_had_errors_p (dpy);
x_uncatch_errors_after_check ();
-
- if (!had_errors_p)
- ret = build_string (name);
-
- if (atom && name) xfree (name);
- if (NILP (ret)) ret = empty_unibyte_string;
-
+ Lisp_Object ret = empty_unibyte_string;
+ if (name)
+ {
+ if (!had_errors_p)
+ ret = build_string (name);
+ xfree (name);
+ }
unblock_input ();
return ret;