+2009-05-29 16:40 +0200 Rocco Rutte <pdmef@gmx.net> (d13500626ea6)
+
+ * menu.c, pager.c, pattern.c: Fall back to search if no query exists
+ for search-(next|opposite)
+
+ The pager had the fall-through to search, so for consistency do that
+ in other menues as well.
+
+2009-05-29 16:21 +0200 Rocco Rutte <pdmef@gmx.net> (4d0640457c77)
+
+ * ChangeLog, pager.c: Fix pager search prompt for reverse search
+
+ When doing a reverse search for the first time after switching to
+ the pager, SearchBack is always 0 and thus gave the wrong prompt,
+ change to using op directly. While I'm at it, unify search prompts.
+
2009-05-29 13:27 +0200 Rocco Rutte <pdmef@gmx.net> (f1a1e50c375d)
* doc/manual.xml.head: Manual: Fix markup of environment variables
if ((f = fopen (HistFile, "r")) == NULL)
return;
- while ((linebuf = mutt_read_line (linebuf, &buflen, f, &line)) != NULL)
+ while ((linebuf = mutt_read_line (linebuf, &buflen, f, &line, 0)) != NULL)
{
read = 0;
if (sscanf (linebuf, "%d:%n", &hclass, &read) < 1 || read == 0 ||
return;
line = 0;
- while ((linebuf = mutt_read_line (linebuf, &buflen, f, &line)) != NULL)
+ while ((linebuf = mutt_read_line (linebuf, &buflen, f, &line, 0)) != NULL)
{
if (sscanf (linebuf, "%d", &hclass) < 1 || hclass < 0)
{
{
rewind (f);
line = 0;
- while ((linebuf = mutt_read_line (linebuf, &buflen, f, &line)) != NULL)
+ while ((linebuf = mutt_read_line (linebuf, &buflen, f, &line, 0)) != NULL)
{
if (sscanf (linebuf, "%d", &hclass) < 1 || hclass < 0)
{
/* read line */
memset (&expn, 0, sizeof (expn));
- expn.data = mutt_read_line (NULL, &expn.dsize, fp, &line);
+ expn.data = mutt_read_line (NULL, &expn.dsize, fp, &line, 0);
safe_fclose (&fp);
mutt_wait_filter (pid);
}
memset (&token, 0, sizeof (token));
- while ((linebuf = mutt_read_line (linebuf, &buflen, f, &line)) != NULL)
+ while ((linebuf = mutt_read_line (linebuf, &buflen, f, &line, M_CONT)) != NULL)
{
conv=ConfigCharset && (*ConfigCharset) && Charset;
if (conv)
* If a line ends with "\", this char and the linefeed is removed,
* and the next line is read too.
*/
-char *mutt_read_line (char *s, size_t *size, FILE *fp, int *line)
+char *mutt_read_line (char *s, size_t *size, FILE *fp, int *line, int flags)
{
size_t offset = 0;
char *ch;
if ((ch = strchr (s + offset, '\n')) != NULL)
{
(*line)++;
+ if (flags & M_EOL)
+ return s;
*ch = 0;
if (ch > s && *(ch - 1) == '\r')
*--ch = 0;
- if (ch == s || *(ch - 1) != '\\')
+ if (!(flags & M_CONT) || ch == s || *(ch - 1) != '\\')
return s;
offset = ch - s - 1;
}
#define S_ERR 127
#define S_BKG 126
+/* Flags for mutt_read_line() */
+#define M_CONT (1<<0) /* \-continuation */
+#define M_EOL (1<<1) /* don't strip \n/\r\n */
+
/* The actual library functions. */
FILE *safe_fopen (const char *, const char *);
char *mutt_concatn_path (char *, size_t, const char *, size_t, const char *, size_t);
char *mutt_concat_path (char *, const char *, const char *, size_t);
-char *mutt_read_line (char *, size_t *, FILE *, int *);
+char *mutt_read_line (char *, size_t *, FILE *, int *, int);
char *mutt_skip_whitespace (char *);
char *mutt_strlower (char *);
char *mutt_substrcpy (char *, const char *, const char *, size_t);
if (!(fp = fopen (pathname, "r")))
return;
- while ((buff = mutt_read_line (buff, &sz, fp, &line)))
+ while ((buff = mutt_read_line (buff, &sz, fp, &line, 0)))
{
if (!(t = strtok (buff, " \t:")))
continue;
/* first, copy unknown sequences */
if ((ofp = fopen (sequences, "r")))
{
- while ((buff = mutt_read_line (buff, &s, ofp, &l)))
+ while ((buff = mutt_read_line (buff, &s, ofp, &l, 0)))
{
if (!mutt_strncmp (buff, seq_unseen, mutt_strlen (seq_unseen)))
continue;
snprintf (sequences, sizeof (sequences), "%s/.mh_sequences", ctx->path);
if ((ofp = fopen (sequences, "r")))
{
- while ((buff = mutt_read_line (buff, &sz, ofp, &line)))
+ while ((buff = mutt_read_line (buff, &sz, ofp, &line, 0)))
{
if (unseen && !strncmp (buff, seq_unseen, mutt_strlen (seq_unseen)))
{
buf[0] = '\0';
tls_fingerprint (GNUTLS_DIG_MD5, buf, sizeof (buf), cert);
- while ((linestr = mutt_read_line(linestr, &linestrsize, fp, &linenum)) != NULL)
+ while ((linestr = mutt_read_line(linestr, &linestrsize, fp, &linenum, 0)) != NULL)
{
if(linestr[0] == '#' && linestr[1] == 'H')
{
int lineno = 0;
size_t linelen;
- while ((line = mutt_read_line (line, &linelen, fpin, &lineno)) != NULL)
+ while ((line = mutt_read_line (line, &linelen, fpin, &lineno, 0)) != NULL)
{
if (regexec (PgpGoodSign.rx, line, 0, NULL, 0) == 0)
{
fgets (msg, sizeof (msg), fp);
if ((p = strrchr (msg, '\n')))
*p = '\0';
- while ((buf = mutt_read_line (buf, &buflen, fp, &dummy)) != NULL)
+ while ((buf = mutt_read_line (buf, &buflen, fp, &dummy, 0)) != NULL)
{
if ((p = strtok(buf, "\t\n")))
{
if ((fp = fopen (filename, "r")) != NULL)
{
- while (!found && (buf = mutt_read_line (buf, &buflen, fp, &line)) != NULL)
+ while (!found && (buf = mutt_read_line (buf, &buflen, fp, &line, M_CONT)) != NULL)
{
/* ignore comments */
if (*buf == '#')
fflush (smimeerr);
rewind (smimeerr);
- line = mutt_read_line (line, &linelen, smimeerr, &lineno);
+ line = mutt_read_line (line, &linelen, smimeerr, &lineno, 0);
if (linelen && !ascii_strcasecmp (line, "verification successful"))
badsig = 0;
rewind (smimeerr);
- line = mutt_read_line (line, &linelen, smimeerr, &lineno);
+ line = mutt_read_line (line, &linelen, smimeerr, &lineno, 0);
if (linelen && !ascii_strcasecmp (line, "verification successful"))
m->goodsig = 1;
FREE (&line);