diff --git a/ChangeLog b/ChangeLog index 0b3851e93a3428b34f66bc61ac1228d842fccdd0..dad868aaef511ccea769deec0bbc843b2104e085 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-11-18 Adrian Bunk <bunk via Savannah> + * nano.c (main) - Allow --fill and --nowrap to override nanorc entries and each other + on the command line. + 2009-11-15 Chris Allegretta <chrisa@asty.org> * winio.c (edit_refresh): Always computer maxsize regardless of whether smooth scrolling is enabled. Fixes Savannah bug 28024 by Mike Frysinger. diff --git a/src/nano.c b/src/nano.c index 416d9e32a13d3d0045a1ae9d62aa6d29131ab8a5..1ef7b5fa41caf161c0bdfe0c30792c4437c0f3ee 100644 --- a/src/nano.c +++ b/src/nano.c @@ -2263,6 +2263,11 @@ int main(int argc, char **argv) #ifndef DISABLE_WRAPPING case 'w': SET(NO_WRAP); + + /* If both --fill and --nowrap are given on the command line, + the last option wins, */ + fill_used = FALSE; + break; #endif case 'x': @@ -2390,6 +2395,11 @@ int main(int argc, char **argv) #endif #endif /* ENABLE_NANORC */ + /* Overwrite an rcfile "set nowrap" or --disable-wrapping-as-root + if a --fill option was given on the command line. */ + if (fill_used) + UNSET(NO_WRAP); + /* If we're using bold text instead of reverse video text, set it up * now. */ if (ISSET(BOLD_TEXT))