SUSv2 specifies that if the extension is identical to the basename, it
should not be removed.
This commit is contained in:
		| @@ -44,7 +44,7 @@ extern int basename_main(int argc, char **argv) | ||||
| 		argv++; | ||||
| 		n = strlen(*argv); | ||||
| 		m = strlen(s); | ||||
| 		if (m>=n && strncmp(s+m-n, *argv, n)==0) | ||||
| 		if (m>n && strncmp(s+m-n, *argv, n)==0) | ||||
| 			s[m-n] = '\0'; | ||||
| 	} | ||||
| 	puts(s); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user