Rather than relying on users to not do something dumb, consider calling realpath() on the two arguments that can be file names. realpath() returns a canonical, simplified version of the paths, so it'll detect the difference of foo.asm and ../src/foo.asm or "foo.asm" and "./foo.asm". Iff the strings returned by realpath differ, you know they're two different file names.
https://github.com/nanochess/pretty6502/blob/192644256c104e5eee72d7c2e98bfff19629dcab/pretty6502.c#L87
Rather than relying on users to not do something dumb, consider calling realpath() on the two arguments that can be file names. realpath() returns a canonical, simplified version of the paths, so it'll detect the difference of foo.asm and ../src/foo.asm or "foo.asm" and "./foo.asm". Iff the strings returned by realpath differ, you know they're two different file names.
Again, just a tip.