From 017e233117368347915089f684986ee3a9c0c113 Mon Sep 17 00:00:00 2001 From: Pierre Habouzit Date: Mon, 19 Mar 2007 00:19:31 +0100 Subject: [PATCH] missing dependency on the lib-sys. Hall of Shame in mutt_gecos_name. --- Makefile.am | 1 + lib-sys/unix.c | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) 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) -- 2.20.1