Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
9c28748f
Commit
9c28748f
authored
Mar 14, 1994
by
Richard M. Stallman
Browse files
(Finsert_file_contents): Don't let same_at_end be less than same_at_start.
parent
f1ecfe9b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
src/fileio.c
src/fileio.c
+9
-0
No files found.
src/fileio.c
View file @
9c28748f
...
...
@@ -2607,6 +2607,8 @@ and (2) it puts less data in the undo list.")
char
buffer
[
1
<<
14
];
int
same_at_start
=
BEGV
;
int
same_at_end
=
ZV
;
int
overlap
;
immediate_quit
=
1
;
QUIT
;
/* Count how many chars at the start of the file
...
...
@@ -2678,9 +2680,16 @@ and (2) it puts less data in the undo list.")
break
;
}
immediate_quit
=
0
;
/* Don't try to reuse the same piece of text twice. */
overlap
=
same_at_start
-
BEGV
-
(
same_at_end
+
st
.
st_size
-
ZV
);
if
(
overlap
>
0
)
same_at_end
+=
overlap
;
/* Arrange to read only the nonmatching middle part of the file. */
XFASTINT
(
beg
)
=
same_at_start
-
BEGV
;
XFASTINT
(
end
)
=
st
.
st_size
-
(
ZV
-
same_at_end
);
del_range_1
(
same_at_start
,
same_at_end
,
0
);
/* Insert from the file at the proper position. */
SET_PT
(
same_at_start
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment