basename(1) bug

utzoo!decvax!harpo!ihnp4!ihps3!ihldt!ll1!otuxa!we13!lime!burdvax!puder utzoo!decvax!harpo!ihnp4!ihps3!ihldt!ll1!otuxa!we13!lime!burdvax!puder
Fri Nov 12 22:11:57 AEST 1982


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.



More information about the Net.bugs.v7 mailing list