LP1567514 - Don't Output Null Byte for Spool Files
authorJason Boyer <jboyer@library.in.gov>
Thu, 7 Apr 2016 16:08:09 +0000 (12:08 -0400)
committerGalen Charlton <gmc@esilibrary.com>
Tue, 24 May 2016 17:44:26 +0000 (13:44 -0400)
If a spool file is defined on the marc_stream_importer.pl
command line, no null byte is output after the record(s)
are processed.

To test:

[1] Use marc_stream_importer.pl to import a record from
    a file; verify that the output messages do not include
    a null character.

Signed-off-by: Jason Boyer <jboyer@library.in.gov>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Open-ILS/src/support-scripts/marc_stream_importer.pl

index 670e8c7..412d466 100755 (executable)
@@ -494,7 +494,7 @@ sub process_file {
     $msg .= "Successfully imported $imported $cur_rec_type records ".
         "using merge profile '$profile'\n" if $imported;
     $msg .= "Failed to import $failed $cur_rec_type records\n" if $failed;
     $msg .= "Successfully imported $imported $cur_rec_type records ".
         "using merge profile '$profile'\n" if $imported;
     $msg .= "Failed to import $failed $cur_rec_type records\n" if $failed;
-    $msg .= "\x00";
+    $msg .= "\x00" unless $spoolfile;
     print $msg;
 
     clear_auth_token(); # logout
     print $msg;
 
     clear_auth_token(); # logout