summaryrefslogtreecommitdiff
diff options
authorChris Allegretta <chrisa@asty.org>2010-07-07 16:07:33 +0000
committerChris Allegretta <chrisa@asty.org>2010-07-07 16:07:33 +0000
commite3f04bd8d5b266731ffadc06e894c53433ac109d (patch)
tree44ceedfb1244857c318758299c686d294a8eb8f1
parent7f86c15ffbfb9c1012be04f0b4d8b4d0e350c190 (diff)
downloadnano_2_0.tar.gz
2010-07-07 Adrian Bunk <bunk via Savannah>nano_2_0
* nano.c (main) - Allow --fill and --nowrap to override nanorc entries and each other on the command line. Backported from 2.2 at request of Benno Schulenberg. git-svn-id: svn://svn.savannah.gnu.org/nano/branches/nano_2_0_branch/nano@4510 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
-rw-r--r--ChangeLog4
-rw-r--r--src/nano.c10
2 files changed, 14 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 305c4d9d..afcaa2d1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-07-07 Adrian Bunk <bunk via Savannah>
+ * nano.c (main) - Allow --fill and --nowrap to override nanorc entries and each other
+ on the command line. Backported from 2.2 at request of Benno Schulenberg.
+
2010-04-25 Chris Allegretta <chrisa@asty.org>
* files.c (do_writeout): Merge in 2.1/2.2 branch modification check and security fixes
(in particular revs 4424 4467 4474 4490 4491 4494 4495 4496 4497 and 4500). Addresses
diff --git a/src/nano.c b/src/nano.c
index 09582bbb..ed5f151c 100644
--- a/src/nano.c
+++ b/src/nano.c
@@ -1963,6 +1963,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':
@@ -2070,6 +2075,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))