--- rxvt-unicode/src/rxvtcolor.C 2004/03/29 21:02:11 1.10 +++ rxvt-unicode/src/rxvtcolor.C 2004/04/04 23:47:29 1.13 @@ -160,7 +160,7 @@ int fd = XConnectionNumber (display); x_ev.start (fd, EVENT_READ); - fcntl (fd, F_SETFL, FD_CLOEXEC); + fcntl (fd, F_SETFD, FD_CLOEXEC); XSelectInput (display, root, PropertyChangeMask); xa_xim_servers = XInternAtom (display, "XIM_SERVERS", 0); @@ -256,12 +256,18 @@ rxvt_xim *rxvt_display::get_xim (const char *locale, const char *modifiers) { - // asprintf is a GNU and *BSD extension.. sorry... char *id; + int l, m; - if (asprintf (&id, "%s\n%s", locale, modifiers) < 0) + l = strlen (locale); + m = strlen (modifiers); + + if (!(id = (char *)malloc (l + m + 2))) return 0; + memcpy (id, locale, l); id[l] = '\n'; + memcpy (id + l + 1, modifiers, m); id[l + m + 1] = 0; + rxvt_xim *xim = xims.get (id); free (id); @@ -274,6 +280,11 @@ xims.put (xim); } +Atom rxvt_display::atom (const char *name) +{ + return XInternAtom (display, name, False); +} + ///////////////////////////////////////////////////////////////////////////// template refcache;