* Copyright (C) 1996-2002 Michael R. Elkins <me@mutt.org>
* Copyright (C) 2004 g10 Code GmbH
*
+ * Parts were written/modified by:
+ * Nico Golde <nico@ngolde.de>
+ *
* This file is part of mutt-ng, see http://www.muttng.org/.
* It's licensed under the GNU General Public License,
* please see the file GPL in the top level source directory.
#include "pager.h"
#include "mbyte.h"
+#include "lib/mem.h"
+#include "lib/intl.h"
+#include "lib/str.h"
+#include "lib/debug.h"
+
#include <termios.h>
#include <sys/types.h>
#include <fcntl.h>
answer_string = safe_malloc (COLS + 1);
snprintf (answer_string, COLS + 1, " ([%s]/%s): ", def == M_YES ? yes : no,
def == M_YES ? no : yes);
- answer_string_len = strlen (answer_string);
+ answer_string_len = mutt_strlen (answer_string);
printw ("%.*s%s", COLS - answer_string_len, msg, answer_string);
FREE (&answer_string);
#else
if (
#endif
- (tolower (ch.ch) == 'y')) {
+ (tolower (ch.ch) == *yes)) {
def = M_YES;
break;
}
#ifdef HAVE_LANGINFO_YESEXPR
reno_ok ? (regexec (&reno, answer, 0, 0, 0) == 0) :
#endif
- (tolower (ch.ch) == 'n')) {
+ (tolower (ch.ch) == *no)) {
def = M_NO;
break;
}
vsnprintf (Errorbuf, sizeof (Errorbuf), fmt, ap);
va_end (ap);
- dprint (1, (debugfile, "%s\n", Errorbuf));
+ debug_print (1, ("%s\n", Errorbuf));
mutt_format_string (TmpErrorbuf, sizeof (TmpErrorbuf),
0, COLS - 2, 0, 0, Errorbuf, sizeof (Errorbuf), 0);
snprintf (Errorbuf, sizeof (Errorbuf), "%s", TmpErrorbuf); /* overkill */
}
}
-void mutt_perror (const char *s)
+void _mutt_perror (const char *s, const char* filename, int line)
{
char *p = strerror (errno);
- dprint (1, (debugfile, "%s: %s (errno = %d)\n", s,
- p ? p : "unknown error", errno));
- mutt_error ("%s: %s (errno = %d)", s, p ? p : _("unknown error"), errno);
+ debug_print (1, ("%s: %s (errno = %d)\n", s, p ? p : "unknown error", errno));
+ mutt_error ("%s: %s (errno = %d) from %s:%i", s, p ? p : _("unknown error"), errno, filename, line);
}
int mutt_any_key_to_continue (const char *s)