summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Kraai2001-07-31 15:01:12 +0000
committerMatt Kraai2001-07-31 15:01:12 +0000
commit51038a3f42018f40f3b256a4887db2e1a3a053f7 (patch)
treec8eb2c6ed46d5e6d8440662c3c7fc608042a871d
parent74bcd1642597109661543d25304c551a2e39acbc (diff)
downloadbusybox-51038a3f42018f40f3b256a4887db2e1a3a053f7.zip
busybox-51038a3f42018f40f3b256a4887db2e1a3a053f7.tar.gz
Don't save and restore readonly flag if BB_FEATURE_VI_READONLY isn't enabled.
-rw-r--r--editors/vi.c6
-rw-r--r--vi.c6
2 files changed, 10 insertions, 2 deletions
diff --git a/editors/vi.c b/editors/vi.c
index cfdc29f..38aee15 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -19,7 +19,7 @@
*/
static const char vi_Version[] =
- "$Id: vi.c,v 1.13 2001/07/19 22:28:01 andersen Exp $";
+ "$Id: vi.c,v 1.14 2001/07/31 15:01:12 kraai Exp $";
/*
* To compile for standalone use:
@@ -1982,9 +1982,13 @@ static void colon(Byte * buf)
// read after current line- unless user said ":0r foo"
if (b != 0)
q = next_line(q);
+#ifdef BB_FEATURE_VI_READONLY
l= readonly; // remember current files' status
+#endif
ch = file_insert(fn, q, file_size(fn));
+#ifdef BB_FEATURE_VI_READONLY
readonly= l;
+#endif
if (ch < 0)
goto vc1; // nothing was inserted
// how many lines in text[]?
diff --git a/vi.c b/vi.c
index cfdc29f..38aee15 100644
--- a/vi.c
+++ b/vi.c
@@ -19,7 +19,7 @@
*/
static const char vi_Version[] =
- "$Id: vi.c,v 1.13 2001/07/19 22:28:01 andersen Exp $";
+ "$Id: vi.c,v 1.14 2001/07/31 15:01:12 kraai Exp $";
/*
* To compile for standalone use:
@@ -1982,9 +1982,13 @@ static void colon(Byte * buf)
// read after current line- unless user said ":0r foo"
if (b != 0)
q = next_line(q);
+#ifdef BB_FEATURE_VI_READONLY
l= readonly; // remember current files' status
+#endif
ch = file_insert(fn, q, file_size(fn));
+#ifdef BB_FEATURE_VI_READONLY
readonly= l;
+#endif
if (ch < 0)
goto vc1; // nothing was inserted
// how many lines in text[]?