void sh_curdir(BYTE *ppath) { WORD drive; /* remember current */ /* directory */ drive = dos_gdrv(); LBSET(ppath++, (drive + 'A') ); LBSET(ppath++, ':'); LBSET(ppath++, '\\'); dos_gdir( drive+1, ppath ); }
WORD sh_path(WORD whichone, LONG dp, BYTE *pname) { register BYTE tmp, last; BYTE *lp; register WORD i; last = 0; /* find PATH= in the */ /* command tail which */ /* is a double null- */ /* terminated string */ sh_envrn(&lp, PATH_ENV); if (!lp) return(0); /* if found count in to */ /* appropriate path */ i = whichone; tmp = ';'; while (i) { while (( tmp = LBGET(lp)) != 0 ) { lp++; if (tmp == ';') break; } i--; } if (!tmp) return(0); /* copy over path */ while ( ( tmp = LBGET(lp) ) != 0) { if ( tmp != ';' ) { LBSET(dp++, tmp); last = tmp; lp++; } else break; } /* see if extra slash */ /* is needed */ if ( (last != '\\') && (last != ':') ) LBSET(dp++, '\\'); /* append file name */ strcpy((char *) dp, pname); /* make whichone refer */ /* to next path */ return(whichone+1); }
VOID LLSTRCPY(LONG src, LONG dest) { BYTE b; do { b = LBGET(src++); LBSET(dest++, b); } while (b); }
VOID ini_buff(VOID) { WORD ii; for (ii = 0; ii < sizeof(RSHDR); ii++) LBSET(head + ii, '\0'); rcs_low = FALSE; rcs_panic = FALSE; rcs_free = head + sizeof(RSHDR); }