From: Michal Vaner Date: Fri, 29 Aug 2008 20:19:50 +0000 (+0200) Subject: Import: fix empty note X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=5cb54af107ba2bd55f9e525e9be5e52707a4adec;p=pciids.git Import: fix empty note It was caused by missing chomp and the note was not empty, it contained only newline --- diff --git a/scripts/importil.pl b/scripts/importil.pl index 7e0fe4b..4f21c85 100755 --- a/scripts/importil.pl +++ b/scripts/importil.pl @@ -46,6 +46,7 @@ sub insertId( $ ) { sub getUser( $ ) { my( $email ) = @_; + $email = "" unless defined $email; $email =~ s/.*<([^<>]*)>.*/$1/; my( $mailCheck ) = emailCheck( $email, undef ); if( defined $mailCheck ) { @@ -88,6 +89,7 @@ sub setMain( $ ) { print "Importing\n"; while( defined( $_ = <> ) ) { + chomp; if( my( $lid ) = /^### ([0-9a-f]+) ###$/ ) { %ids = (); @toMark = ();