diff options
author | Matt Kraai <kraai@debian.org> | 2001-07-31 15:01:12 +0000 |
---|---|---|
committer | Matt Kraai <kraai@debian.org> | 2001-07-31 15:01:12 +0000 |
commit | 51038a3f42018f40f3b256a4887db2e1a3a053f7 (patch) | |
tree | c8eb2c6ed46d5e6d8440662c3c7fc608042a871d | |
parent | 74bcd1642597109661543d25304c551a2e39acbc (diff) | |
download | busybox-w32-51038a3f42018f40f3b256a4887db2e1a3a053f7.tar.gz busybox-w32-51038a3f42018f40f3b256a4887db2e1a3a053f7.tar.bz2 busybox-w32-51038a3f42018f40f3b256a4887db2e1a3a053f7.zip |
Don't save and restore readonly flag if BB_FEATURE_VI_READONLY isn't enabled.
-rw-r--r-- | editors/vi.c | 6 | ||||
-rw-r--r-- | vi.c | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/editors/vi.c b/editors/vi.c index cfdc29fcb..38aee15d7 100644 --- a/editors/vi.c +++ b/editors/vi.c | |||
@@ -19,7 +19,7 @@ | |||
19 | */ | 19 | */ |
20 | 20 | ||
21 | static const char vi_Version[] = | 21 | static 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[]? |
@@ -19,7 +19,7 @@ | |||
19 | */ | 19 | */ |
20 | 20 | ||
21 | static const char vi_Version[] = | 21 | static 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[]? |