aboutsummaryrefslogtreecommitdiff
path: root/vi.c
diff options
context:
space:
mode:
authorkraai <kraai@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-07-31 15:01:12 +0000
committerkraai <kraai@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-07-31 15:01:12 +0000
commit5ed6e1b304a8fa15e1afd81a111334190ea97113 (patch)
treec8eb2c6ed46d5e6d8440662c3c7fc608042a871d /vi.c
parentc6312c270adf0ecceac516c1a3b647eb79229a73 (diff)
downloadbusybox-w32-5ed6e1b304a8fa15e1afd81a111334190ea97113.tar.gz
busybox-w32-5ed6e1b304a8fa15e1afd81a111334190ea97113.tar.bz2
busybox-w32-5ed6e1b304a8fa15e1afd81a111334190ea97113.zip
Don't save and restore readonly flag if BB_FEATURE_VI_READONLY isn't enabled.
git-svn-id: svn://busybox.net/trunk/busybox@3166 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to '')
-rw-r--r--vi.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/vi.c b/vi.c
index cfdc29fcb..38aee15d7 100644
--- a/vi.c
+++ b/vi.c
@@ -19,7 +19,7 @@
19 */ 19 */
20 20
21static const char vi_Version[] = 21static const char vi_Version[] =
22 "$Id: vi.c,v 1.13 2001/07/19 22:28:01 andersen Exp $"; 22 "$Id: vi.c,v 1.14 2001/07/31 15:01:12 kraai Exp $";
23 23
24/* 24/*
25 * To compile for standalone use: 25 * To compile for standalone use:
@@ -1982,9 +1982,13 @@ static void colon(Byte * buf)
1982 // read after current line- unless user said ":0r foo" 1982 // read after current line- unless user said ":0r foo"
1983 if (b != 0) 1983 if (b != 0)
1984 q = next_line(q); 1984 q = next_line(q);
1985#ifdef BB_FEATURE_VI_READONLY
1985 l= readonly; // remember current files' status 1986 l= readonly; // remember current files' status
1987#endif
1986 ch = file_insert(fn, q, file_size(fn)); 1988 ch = file_insert(fn, q, file_size(fn));
1989#ifdef BB_FEATURE_VI_READONLY
1987 readonly= l; 1990 readonly= l;
1991#endif
1988 if (ch < 0) 1992 if (ch < 0)
1989 goto vc1; // nothing was inserted 1993 goto vc1; // nothing was inserted
1990 // how many lines in text[]? 1994 // how many lines in text[]?