Mail Archives: djgpp-workers/1996/11/13/12:59:45
It seems there is a bug in the stub: when the basename of the symlink in
the stubinfo structure has exactly 8 characters, the stub won't run it.
To reproduce:
cp gcc.exe x2345678.exe
ln -s x2345678.exe xlink.exe
xlink
or
xcopy gcc.exe x2345678.exe
stubify -g xlink.exe
stubedit xlink.exe runfile=x2345678
xlink
This should produce "x2345678.EXE: Cannot open" error message.
I think the problem is in the following fragment from stub.asm:
;-----------------------------------------------------------------------------
; Replace the stub's file name with the link's name after the directory
mov cx, 8 ; max length of basename
mov di, stubinfo_basename ; pointer to new basename
@b1:
mov al, [di] ; get next character
inc di
or al, al ; end of basename?
je @f1
mov [bx], al ; store character
inc bx
loop @b1 ; eight characters?
@f1:
movd [bx+0], 0x4558452e ; append ".EXE"
add bx, 4
mov [bx], al ; al = 0
mov [loadname_nul], bx ; remember nul so we can change
There: it assumes that AL holds a zero, but in the case that there are
exactly 8 characters, it doesn't (it holds the last character of the
basename instead).
I don't want to suggest a fix, since I don't know how to do it in a way
that uses the least number of bytes.
If I'm right, this problem is IMHO serious enough to justify another
update of djdev.
- Raw text -