This is the second patch for this code submitted recently. Ok, what happened to cause such a problem to mysteriously appear? ;-) http://sources.redhat.com/ml/binutils/2001-10/msg00337.html The lbasename() function should be used in your patch. It does what you want already.