From 45523183e43624c4b2f0f579fe2b38c6444e03e9 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Mon, 12 Oct 2009 17:40:24 +0000 Subject: [PATCH] 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 --- scripts/specialize-patch | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/scripts/specialize-patch b/scripts/specialize-patch index 2700f203c..1f560ef55 100755 --- a/scripts/specialize-patch +++ b/scripts/specialize-patch @@ -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() }