Date: Wed, 13 Nov 1996 19:35:45 +0200 (IST) From: Eli Zaretskii To: djgpp-workers AT delorie DOT com Cc: Charles Sandmann , DJ Delorie Subject: Cannot symlink when basename is 8 chars Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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.