From 2e9b880fba8e5dffb4513fc9bf301a1991e5cfab Mon Sep 17 00:00:00 2001 From: root Date: Mon, 14 Feb 2005 20:46:47 +0000 Subject: [PATCH] *** empty log message *** --- Changes | 8 ++++---- src/rxvtc.C | 13 ++++++++++--- src/rxvtd.C | 3 +++ src/rxvtfont.C | 6 ++++-- 4 files changed, 21 insertions(+), 9 deletions(-) diff --git a/Changes b/Changes index e76d97fb..af35f3de 100644 --- a/Changes +++ b/Changes @@ -16,16 +16,16 @@ WISH: just for fun, do shade and tint with XRender. for empty keymaps which could result in crashes (Kuang-che Wu). - new option: -embed (frills). somebody could write a simple - tk script to make a tabbable terminal now. + tk script to make a tab'able terminal now... - only warn on X errors, *try* to continue (frills). - add COPYING back, which got lost somehow. - after deciding that LSM is dead, remove all traces of it, along with other, similar, cleanups. - _try_ to react sensibly to some non-monotonic time changes. - don't crash in urxvtc when getcwd fails (reported by Paco-Paco). - - tweak font searching algorithm a bit to get faster and be - more compatible with the font older rxvt-unicode versions chose - (reported by Paco-Paco). + - tweak font searching algorithm a bit to be faster and more + compatible with older rxvt-unicode versions when multiple fonts + match (reported by Paco-Paco). - urxvtd tries to stay in "/" whenever possible. 5.0 Fri Feb 11 18:31:48 CET 2005 diff --git a/src/rxvtc.C b/src/rxvtc.C index 8f70becb..f4db4d1b 100644 --- a/src/rxvtc.C +++ b/src/rxvtc.C @@ -65,8 +65,6 @@ int main (int argc, const char *const *argv) { client c; - char buf[PATH_MAX]; - { sigset_t ss; @@ -76,8 +74,17 @@ main (int argc, const char *const *argv) } c.send ("NEW"); + // instead of getcwd we could opendir (".") and pass the fd for fchdir *g* - c.send ("CWD"), c.send (getcwd (buf, sizeof (buf))); + char cwd[PATH_MAX]; + + if (!getcwd (cwd, sizeof (cwd))) + { + perror ("unable to determine current working directory"); + exit (EXIT_FAILURE); + } + + c.send ("CWD"), c.send (cwd); for (char **var = environ; *environ; environ++) c.send ("ENV"), c.send (*environ); diff --git a/src/rxvtd.C b/src/rxvtd.C index 67048a5f..6c56f4b2 100644 --- a/src/rxvtd.C +++ b/src/rxvtd.C @@ -196,6 +196,7 @@ void server::read_cb (io_watcher &w, short revents) term->log_hook = 0; environ = old_environ; + chdir ("/"); if (!success) term->destroy (); @@ -215,6 +216,8 @@ main (int argc, const char *const *argv) { rxvt_init (); + chdir ("/"); + char *sockname = rxvt_connection::unix_sockname (); unix_listener l (sockname); printf ("rxvt-unicode daemon listening on %s.\n", sockname); diff --git a/src/rxvtfont.C b/src/rxvtfont.C index 22e677eb..2c0fdd0f 100644 --- a/src/rxvtfont.C +++ b/src/rxvtfont.C @@ -718,6 +718,8 @@ rxvt_font_x11::load (const rxvt_fontprop &prop) if (replace_field (fname, list[i], 6, '0', field_str)) diff += 10; // slightly penalize scalable fonts + else if (replace_field (fname, list[i], 11, '0', "0")) + diff += 300; // more heavily penalize what looks like scaled bitmap fotns if (!set_properties (p, fname)) continue; @@ -743,7 +745,7 @@ rxvt_font_x11::load (const rxvt_fontprop &prop) font_weight *best = fonts + count - 1; for (font_weight *w = best; w-- > fonts; ) - if (w->diff < best->diff) + if (w->diff <= best->diff) best = w; if (!best->name @@ -1098,7 +1100,7 @@ rxvt_font_xft::load (const rxvt_fontprop &prop) FcValue v; if (prop.height != rxvt_fontprop::unset - || (FcPatternGet (p, FC_PIXEL_SIZE, 0, &v) != FcResultMatch + && (FcPatternGet (p, FC_PIXEL_SIZE, 0, &v) != FcResultMatch && FcPatternGet (p, FC_SIZE, 0, &v) != FcResultMatch)) FcPatternAddInteger (p, FC_PIXEL_SIZE, prop.height); -- 2.34.1