From: Jelmer Vernooij Date: Mon, 22 Dec 2008 02:21:10 +0000 (+0100) Subject: pidl: Allow location argument to warning() and error() to be undef, in case it is X-Git-Tag: samba-4.0.0alpha6~432 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7ebc7e677d3d2a70c832a672e9f2e6b12896354f;p=thirdparty%2Fsamba.git pidl: Allow location argument to warning() and error() to be undef, in case it is not known. --- diff --git a/pidl/lib/Parse/Pidl.pm b/pidl/lib/Parse/Pidl.pm index c2c9463d03f..40e3673908e 100644 --- a/pidl/lib/Parse/Pidl.pm +++ b/pidl/lib/Parse/Pidl.pm @@ -20,13 +20,19 @@ $VERSION = '0.02'; sub warning { my ($l,$m) = @_; - print STDERR "$l->{FILE}:$l->{LINE}: warning: $m\n"; + if ($l) { + print STDERR "$l->{FILE}:$l->{LINE}: "; + } + print STDERR "warning: $m\n"; } sub error { my ($l,$m) = @_; - print STDERR "$l->{FILE}:$l->{LINE}: error: $m\n"; + if ($l) { + print STDERR "$l->{FILE}:$l->{LINE}: "; + } + print STDERR "error: $m\n"; } sub fatal($$)