+2009-12-01 Kamil Dudka <kdudka@redhat.com>
+ * chars.c, file.c - Better handle unused results for things like mbtowc(), new
+ macro IGNORE_CALL_RESULT.
+
+2009-12-01 Chris Allegretta <chrisa@asty.org>
+ * global.c (shortcut_init) - Remove redundant entries for ^Y/^V reported by
+ Christian Weisgerber.
+ * doc/man/nanorc.5 - Fix typo in Meta documentation, reported by gibboris@gmail.com.
+
+2009-11-29 David Lawrence Ramsey <pooka109@gmail.com>
+ * global.c (shortcut_init) - Add support for ^P and ^N in the help menu.
+
GNU nano 2.2.0 - 2009.11.30
2009-11-29 Chris Allegretta <chrisa@asty.org>
- * prompt.c (get_prompt_string) - Universally handle help key when is disabled. Fixes Savannah
+ * prompt.c (get_prompt_string) - Universally handle help key when is
+disabled. Fixes Savannah
bug 28117 by David Lawrence Ramsey <pooka109@gmail.com>.
* chars.c, files.c: Add junk vars to silence the compiler. Sigh.
#
# $Id$
-AC_INIT([GNU nano], [2.2.0], [nano-devel@gnu.org], [nano])
+AC_INIT([GNU nano], [2.2.0-svn], [nano-devel@gnu.org], [nano])
AC_CONFIG_SRCDIR([src/nano.c])
AC_CANONICAL_TARGET([])
AM_INIT_AUTOMAKE
Example: ^C
.TP
.B M-
-followed by a prinable character or the word "Space".
+followed by a printable character or the word "Space".
Example: M-C
.TP
.B F
return ((unsigned int)c == (unsigned char)c);
}
+static void mbtowc_reset(void)
+{
+ IGNORE_CALL_RESULT(mbtowc(NULL, NULL, 0));
+}
+
+static void wctomb_reset(void)
+{
+ IGNORE_CALL_RESULT(wctomb(NULL, 0));
+}
+
/* This function is equivalent to isalnum() for multibyte characters. */
bool is_alnum_mbchar(const char *c)
{
wchar_t wc;
if (mbtowc(&wc, c, MB_CUR_MAX) < 0) {
- int shutup = mbtowc(NULL, NULL, 0);
+ mbtowc_reset();
wc = bad_wchar;
}
wchar_t wc;
if (mbtowc(&wc, c, MB_CUR_MAX) < 0) {
- int shutup = mbtowc(NULL, NULL, 0);
+ mbtowc_reset();
wc = bad_wchar;
}
wchar_t wc;
if (mbtowc(&wc, c, MB_CUR_MAX) < 0) {
- int shutup = mbtowc(NULL, NULL, 0);
+ mbtowc_reset();
wc = bad_wchar;
}
int c_mb_len = mbtowc(&wc, c, MB_CUR_MAX);
if (c_mb_len < 0) {
- int shutup = mbtowc(NULL, NULL, 0);
+ mbtowc_reset();
wc = bad_wchar;
}
wchar_t wc;
if (mbtowc(&wc, c, MB_CUR_MAX) < 0) {
- int shutup = mbtowc(NULL, NULL, 0);
+ mbtowc_reset();
*crep_len = bad_mbchar_len;
strncpy(crep, bad_mbchar, *crep_len);
} else {
*crep_len = wctomb(crep, control_wrep(wc));
if (*crep_len < 0) {
- int shutup = wctomb(NULL, 0);
+ wctomb_reset();
*crep_len = 0;
}
}
/* Reject invalid Unicode characters. */
if (mbtowc(&wc, c, MB_CUR_MAX) < 0 || !is_valid_unicode(wc)) {
- int shutup = mbtowc(NULL, NULL, 0);
+ mbtowc_reset();
*crep_len = bad_mbchar_len;
strncpy(crep, bad_mbchar, *crep_len);
} else {
*crep_len = wctomb(crep, wc);
if (*crep_len < 0) {
- int shutup = wctomb(NULL, 0);
+ wctomb_reset();
*crep_len = 0;
}
}
int width;
if (mbtowc(&wc, c, MB_CUR_MAX) < 0) {
- int shutup = mbtowc(NULL, NULL, 0);
+ mbtowc_reset();
wc = bad_wchar;
}
/* Reject invalid Unicode characters. */
if (*chr_mb_len < 0 || !is_valid_unicode((wchar_t)chr)) {
- int shutup = wctomb(NULL, 0);
+ wctomb_reset();
*chr_mb_len = 0;
}
} else {
/* If buf contains an invalid multibyte character, only
* interpret buf's first byte. */
if (buf_mb_len < 0) {
- int shutup = mblen(NULL, 0);
+ IGNORE_CALL_RESULT(mblen(NULL, 0));
buf_mb_len = 1;
} else if (buf_mb_len == 0)
buf_mb_len++;
s1_mb_len = parse_mbchar(s1, s1_mb, NULL);
if (mbtowc(&ws1, s1_mb, s1_mb_len) < 0) {
- int shutup = mbtowc(NULL, NULL, 0);
+ mbtowc_reset();
ws1 = (unsigned char)*s1_mb;
bad_s1_mb = TRUE;
}
s2_mb_len = parse_mbchar(s2, s2_mb, NULL);
if (mbtowc(&ws2, s2_mb, s2_mb_len) < 0) {
- int shutup = mbtowc(NULL, NULL, 0);
+ mbtowc_reset();
ws2 = (unsigned char)*s2_mb;
bad_s2_mb = TRUE;
}
int c_mb_len = mbtowc(&wc, c, MB_CUR_MAX);
if (c_mb_len < 0) {
- int shutup = mbtowc(NULL, NULL, 0);
+ mbtowc_reset();
wc = (unsigned char)*c;
bad_c_mb = TRUE;
}
int s_mb_len = parse_mbchar(s, s_mb, NULL);
if (mbtowc(&ws, s_mb, s_mb_len) < 0) {
- int shutup = mbtowc(NULL, NULL, 0);
+ mbtowc_reset();
ws = (unsigned char)*s;
bad_s_mb = TRUE;
}
char *d_here, *d_there, *d_there_file = NULL;
const char *last_slash;
bool path_only;
- int shutup;
if (origpath == NULL)
return NULL;
/* Finally, go back to the path specified in d_here,
* where we were before. We don't check for a chdir()
* error, since we can do nothing if we get one. */
- shutup = chdir(d_here);
+ IGNORE_CALL_RESULT(chdir(d_here));
/* Free d_here, since we're done using it. */
free(d_here);
#endif
add_to_funcs(DO_FIRST_LINE,
- (MMAIN|MWHEREIS|MREPLACE|MREPLACE2|MGOTOLINE|MHELP),
+ (MMAIN|MWHEREIS|MREPLACE|MREPLACE2|MGOTOLINE),
first_line_msg, IFSCHELP(nano_firstline_msg), FALSE, VIEW);
add_to_funcs(DO_LAST_LINE,
- (MMAIN|MWHEREIS|MREPLACE|MREPLACE2|MGOTOLINE|MHELP),
+ (MMAIN|MWHEREIS|MREPLACE|MREPLACE2|MGOTOLINE),
last_line_msg, IFSCHELP(nano_lastline_msg), TRUE, VIEW);
add_to_sclist(MALL, "kleft", DO_LEFT, 0, TRUE);
add_to_sclist(MMAIN, "^Q", XON_COMPLAINT, 0, TRUE);
add_to_sclist(MMAIN, "^S", XOFF_COMPLAINT, 0, TRUE);
- add_to_sclist(MMAIN|MBROWSER, "^P", DO_UP_VOID, 0, TRUE);
- add_to_sclist(MMAIN|MBROWSER, "kup", DO_UP_VOID, 0, TRUE);
- add_to_sclist(MMAIN|MBROWSER, "^N", DO_DOWN_VOID, 0, TRUE);
- add_to_sclist(MMAIN|MBROWSER, "kdown", DO_DOWN_VOID, 0, TRUE);
+ add_to_sclist(MMAIN|MHELP|MBROWSER, "^P", DO_UP_VOID, 0, TRUE);
+ add_to_sclist(MMAIN|MHELP|MBROWSER, "kup", DO_UP_VOID, 0, TRUE);
+ add_to_sclist(MMAIN|MHELP|MBROWSER, "^N", DO_DOWN_VOID, 0, TRUE);
+ add_to_sclist(MMAIN|MHELP|MBROWSER, "kdown", DO_DOWN_VOID, 0, TRUE);
add_to_sclist(MALL, "^A", DO_HOME, 0, TRUE);
add_to_sclist(MALL, "khome", DO_HOME, 0, TRUE);
add_to_sclist(MALL, "^E", DO_END, 0, TRUE);
#include <stdarg.h>
#endif
+/* Suppress warnings for __attribute__((warn_unused_result)) */
+#define IGNORE_CALL_RESULT(call) do { if (call) {} } while(0)
+
/* Macros for flags. */
#define FLAGOFF(flag) ((flag) / (sizeof(unsigned) * 8))
#define FLAGMASK(flag) (1 << ((flag) % (sizeof(unsigned) * 8)))