From: Pierre Habouzit Date: Sun, 18 Mar 2007 23:19:31 +0000 (+0100) Subject: missing dependency on the lib-sys. X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=commitdiff_plain;h=017e233117368347915089f684986ee3a9c0c113 missing dependency on the lib-sys. Hall of Shame in mutt_gecos_name. --- diff --git a/Makefile.am b/Makefile.am index 65c1bee..bd8aab9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -48,6 +48,7 @@ madmutt_DEPENDENCIES = $(top_builddir)/lib-lua/madmutt.li \ $(top_builddir)/lib-mime/libmime.a \ $(top_builddir)/lib-crypt/libcrypt.a \ $(top_builddir)/lib-hash/libhash.a \ + $(top_builddir)/lib-sys/libsys.a \ $(top_builddir)/lib-ui/libui.a \ $(top_builddir)/lib-lua/liblua.a \ $(top_builddir)/lib-mx/libmx.a \ diff --git a/lib-sys/unix.c b/lib-sys/unix.c index 9054435..3e2c23d 100644 --- a/lib-sys/unix.c +++ b/lib-sys/unix.c @@ -39,16 +39,16 @@ ssize_t mutt_gecos_name(char *dst, ssize_t n, struct passwd *pw, rx_t *rx) } p = pw->pw_gecos + pat_match[0].rm_so; - end = pw->pw_gecos + pat_match[0].rm_so; + end = pw->pw_gecos + pat_match[0].rm_eo; } else { p = pw->pw_gecos; end = m_strchrnul(pw->pw_gecos, ','); } for (;;) { - const char *q = MIN(end, m_strchrnul(p, '&')); + const char *q = m_strchrnul(p, '&'); - len += m_strncpy(dst + len, n - len, p, q - p); + len += m_strncpy(dst + len, n - len, p, MIN(end, q) - p); p = q + 1; if (!p[-1] || p >= end)