http://www.ousob.com --- Legacy Redefined #include <string.h> #include <extend50.h> #define MK_FP(seg,ofs) ((void far *) \ (((unsigned long)(seg) << 16) | (unsigned)(ofs))) #define FP_OFF(fp) ((unsigned)(fp)) #define FP_SEG(fp) ((unsigned)((unsigned long)(fp) >> 16)) extern unsigned _psp; CLIPPER b_exename() { char far *Env; char pbuff[128]; unsigned far *EnvSeg; getcwd(pbuff,128); EnvSeg = MK_FP(_psp,0x2c); Env = MK_FP(*EnvSeg,0x00); while(1){ if( *Env++==0 ){ if( *Env++==0 ){ break; } } } Env++; Env++; if( ISCHAR(1) && (strcmp("DEBUG",_parc(1))) == 0 ){ _retc(pbuff); } else{ _retc(strupr(Env)); } }