Mail Archives: djgpp/2000/11/07/17:15:23
By commenting out some code I can get the compiled UNZIPSFX.EXE to label
the floppy. The original code causes the program to skip the labelling:
if (uO.volflag == 0 || *buildpath < 'a' || /* no label/bogus disk */
(uO.volflag == 1 && !isfloppy(nLabelDrive))) /* -$: no fixed */
If I comment out the second line it works, so either the -$ parameter is
not setting u0.volflag, or isfloppy() is returning the wrong result. (I
guess).
I don't understand isfloppy() at all, but it's short. Please tell me if
you can see anything wrong. (I put a printf("Error") in the error clause
and it did not print out.)
/***********************/
/* Function isfloppy() */
/***********************/
static int isfloppy(nDrive) /* more precisely, is it removable? */
int nDrive;
{
union REGS regs;
regs.h.ah = 0x44;
regs.h.al = 0x08;
regs.h.bl = (uch)nDrive;
#ifdef __EMX__
_int86(0x21, ®s, ®s);
if (WREGS(regs,flags) & 1)
#else
intdos(®s, ®s);
if (WREGS(regs,cflag)) /* error: do default a/b check instead */
#endif
{
Trace((stderr,
"error in DOS function 0x44 (AX = 0x%04x): guessing instead...\n",
WREGS(regs,ax)));
return (nDrive == 1 || nDrive == 2)? TRUE : FALSE;
} else
return WREGS(regs,ax)? FALSE : TRUE;
}
--
James Owens ad354 AT Freenet DOT carleton DOT ca
Ottawa, Ontario, Canada
- Raw text -