🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.bugs.v7
Article #99

Re: basename(1) bug

#99
From: utzoodecvaxharpoihnp4ihps3ihldtl...
Date: Fri, 12 Nov 1982 22:11
21 lines
831 bytes
Correction: that and in the if should be an OR!
change this:

	while(p1>p2 && p3>argv[2])
		if(*--p3 != *--p1)

to this:

	while(p3>argv[2])
		if(p1 <= p2 || *--p3 != *--p1)

NOT this:

	while(p3>argv[2])
		if(p1 <= p2 && *--p3 != *--p1)

With the and in there, it will always infinite loop.

There is some comment about the algebra of logical statements that I
should make here, but I can't seem to phrase it right now.
Something about DeMorgan's laws.
Technical Details
Message-ID: <bnews.burdvax.339>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: utzoo.2484

Show Full Headers
Complete Article Headers
From: utzoo!decvax!harpo!ihnp4!ihps3!ihldt!ll1!otuxa!we13!lime!burdvax!puder
Newsgroups: net.bugs.v7
Title: Re: basename(1) bug
Article-I.D.: burdvax.339
Posted: Fri Nov 12 22:11:57 1982
Received: Mon Nov 15 07:07:01 1982
References: utzoo.2484
Subject: Re: basename(1) bug
Date: Fri, 12 Nov 1982 22:11:57 +0000
Message-ID: <bnews.burdvax.339>