Made sure all per-hunk state variables are initialized properly.

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1204 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2009-10-12 17:40:24 +00:00
parent 17c48b03f4
commit 45523183e4

View File

@@ -279,6 +279,14 @@ function process_preprocessor_statement() {
}
}
function reset_hunk_state_variables() {
lines = 0
lines_deleted = 0
output = 1
if_nesting_level = -1
delete_next_blank_line = 0
}
function dump_lines() {
# Detect empty hunks
first_modif = -1
@@ -299,8 +307,7 @@ function dump_lines() {
for (i = 0; i < lines; i++)
print line[i]
}
lines = 0
lines_deleted = 0
reset_hunk_state_variables()
}
BEGIN {
@@ -320,11 +327,7 @@ BEGIN {
delete_disabled_code = 0
# Variable initialization.
lines = 0
lines_deleted = 0
output = 1
if_nesting_level = -1
delete_next_blank_line = 0
reset_hunk_state_variables()
}