From cef2eef04fa67f9ef12e54dd6fcdfd499ceb693f Mon Sep 17 00:00:00 2001 From: Shawn Boyette Date: Tue, 11 Nov 2008 16:46:16 +0000 Subject: [PATCH] edit now sets $ptr to zero on exit, forcing checks of all manual edits --- marc-cleanup | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/marc-cleanup b/marc-cleanup index 96f3250..834331e 100755 --- a/marc-cleanup +++ b/marc-cleanup @@ -70,7 +70,6 @@ while ( buildrecord() ) { my $match = $1; if ($match =~ /\D/) { edit("Non-numerics in tag"); - $ptr = 0; next; } } @@ -80,7 +79,6 @@ while ( buildrecord() ) { my $match = $1; if ($match =~ /\P{IsAlnum}/ or $match eq '') { edit("Junk in subfield code/Null subfield code"); - $ptr = 0; next; } } @@ -208,6 +206,7 @@ sub edit { print_linecontext(); } } + $ptr = 0; } =head2 buildrecord @@ -292,7 +291,7 @@ sub print_linecontext { my $low = ($ptr - 3 < 0) ? 0 : $ptr - 3; print $OUT ' |', $record[$_] for ($low .. $ptr - 1); print $OUT '==> |', $record[$ptr]; - print $OUT ' |', $record[$ptr + 1], "\n"; + print $OUT ' |', $record[$ptr + 1], "\n" unless ($ptr == $#record); return 0; } -- 1.7.2.5