Mail Archives: djgpp-workers/2001/03/04/10:32:21
Hello.
Richard Dawe wrote:
> I am unsure how to decide that a file is a DOS batch file. The patches
> to ginstall for DJGPP currently modify the target filename, depending on
> the source file's file format. Here's some pseudo-code:
>
> if (_check_v2_prog returns valid data) {
> if (unstubbed COFF) {
> stubify
> append .exe to target filename
> } else if (stubbed COFF) {
> append .exe to target filename
> } else {
> if (file header contains "MZ") {
> /* FIXME: Distinguish between .exe and .com */
> append .exe to target filename
> }
> }
I missed out an outer if condition - that the from file has no .com or
.exe extension. I think I've been thinking about this the wrong way.
Clearly ginstall needs to handle:
ginstall file.$(EXEEXT) a
by copying to a.$(EXEEXT) instead, where $(EXEEXT) is an executable
extension.
Also, so 'a' is not a batch file even if 'a' contains batch file commands,
because it does not have a .bat extension. So my original question is
actually bogus in the context that I meant it (my fault).
OK, now I can handle the other cases, where source has an executable
extension, but target does not. Tim, Martin, thanks for the help.
Bye, Rich =]
--
Richard Dawe <richdawe AT bigfoot DOT com> http://www.bigfoot.com/~richdawe/
"The soul is the mirror of an indestructible universe."
--- Gottfried W. Leibniz
- Raw text -