summaryrefslogtreecommitdiff
path: root/editors/vi.c
diff options
context:
space:
mode:
authorDenys Vlasenko2015-10-08 11:24:44 +0200
committerDenys Vlasenko2015-10-08 11:24:44 +0200
commit7f3a2a22569eb8e4c9fcc1c7f4e51fe0c6155dae (patch)
treeca48b19046a8de875054b240f7713a09cb9a5358 /editors/vi.c
parentd60752f8c9be5689a249ad518deb38061d4bc45e (diff)
downloadbusybox-7f3a2a22569eb8e4c9fcc1c7f4e51fe0c6155dae.zip
busybox-7f3a2a22569eb8e4c9fcc1c7f4e51fe0c6155dae.tar.gz
join some common strings, -400 bytes
function old new delta print_intel_cstates 499 511 +12 file_insert 355 364 +9 dpkg_main 2944 2940 -4 ifenslave_main 645 640 -5 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/2 up/down: 21/-9) Total: 12 bytes text data bss dec hex filename 937564 932 17676 956172 e970c busybox_old 937164 932 17676 955772 e957c busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'editors/vi.c')
-rw-r--r--editors/vi.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/editors/vi.c b/editors/vi.c
index 3db597a..f355712 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -2910,10 +2910,10 @@ static int file_insert(const char *fn, char *p, int initial)
int fd, size;
struct stat statbuf;
- if (p < text || p > end) {
- status_line_bold("Trying to insert file outside of memory");
- return cnt;
- }
+ if (p < text)
+ p = text;
+ if (p > end)
+ p = end;
fd = open(fn, O_RDONLY);
if (fd < 0) {