Ethereal-dev: Re: [Ethereal-dev] Bug in make-version.pl?

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Thomas Boehne <TBoehne@xxxxxxxx>
Date: Thu, 16 Dec 2004 16:54:21 +0100
On Thursday 16 December 2004 16:10, Joerg Mayer wrote:
> On Thu, Dec 16, 2004 at 02:08:37PM +0100, Thomas Boehne wrote:
> > I assume that if version.conf is not present, make-version.pl should
> > issue a warning. However, it does not seem to work, and I don't know
> > perl well enough to fix it properly.

> I don't think that it should issue a warning - on the contrary, it
> shouldn't. make-version.pl behaves somewhat differently depending on the
> presence/ absence of this file.

Well, it looks like the following code in make-version.pl is never
executed, so I think it should either be removed or fixed: 

print STDERR "Version configuration file $vconf_file not found.  Using defaults.\n";

My previous fix seems to be incorrect, as I expected. This is what I
am using now, it is not confusing me and seems to work:

        if (! open(FILE, "<$vconf_file")) {
            print STDERR "Version configuration file $vconf_file not found.  Using defaults.\n";
            return 1;
        }

I did some testing, and I think the author of that line meant the
following (note the parentheses after print):

open(FILE, "<$vconf_file") || print(STDERR "Version configuration file $vconf_file not found.  Using defaults.\n") && return 1;

In the original version, Perl tried to print the expression

"Version configuration..." && return 1

it evaluated the whole statement (at least that is how I understood
"man perlop"). So "return 1" was executed before printf.

By the way, after downloading the release source code I found out how
to compile a release from the svn tree -- I had to create an empty
svnversion.h file, and a version.conf file that contains "enable: 0".
I hope this was the correct way to do it.

Sincerely yours, 
Thomas Böhne

-- 
Jäger Computergesteuerte Messtechnik GmbH
Thomas Böhne
Rheinstraße 2-4
64653 Lorsch
Germany
Phone: +49-6251-9632-0