From: 065211 AT bud DOT cc DOT swin DOT edu DOT au (MURPHY, Jeremy W) Newsgroups: comp.os.msdos.djgpp Subject: Re: Which editor, and, install prob with tmp dir Date: 18 Dec 2002 05:54:02 GMT Organization: Swinburne University of Technology Lines: 79 Message-ID: References: NNTP-Posting-Host: bud.cc.swin.edu.au X-Trace: c3p0.cc.swin.edu.au 1040190842 2030 136.186.1.113 (18 Dec 2002 05:54:02 GMT) X-Complaints-To: abuse AT swin DOT edu DOT au NNTP-Posting-Date: 18 Dec 2002 05:54:02 GMT X-Newsreader: TIN [version 1.2 PL2] To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Andrew Cottrell (andnews AT ihug DOT com DOT oz DOT au) wrote: : How about setedit? It's smaller than Rhide and is the editor that is : included in Rhide. Yeah, forgot that Setedit is a stand-alone editor in itself. : What is the problem with compilng Joe? In path.c it tries to define opendir(), closedir() and readdir(), which is easy enough to fix. Then in scrn.c it goes ballistic about "structure has no member named `rr', `top', `bot', `x', `y', etc." I guess it's something to do with ncurses? From memory I installed 5.2 from source, maybe there's a djgpp specific package I should've installed instead. : >Anyway, main query : >2. Why is getenv("TMPDIR") returning "c:\djgpp\tmp" (back slashes) when from : >bash, TMPDIR is definitely set with forward slashes? Thanks in advance : >for help on this one, it's driving me... buggy! :) : I may be wrong with this, but BASH is a unix shell and as such will : try to convert backslashs to forward slashes. It can use either and : converts between both. : The setup code to populate the environment variables copies DOS memory : and as dos uses backslahes when you call getenv() there are : backslashes in it. See crt1.c for environment setup. Hmmm, but TMPDIR is not defined in my normal DOS environment, only in bash (.bash_login). I fixed it for TMPDIR by changing +TMPDIR=%DJDIR%/tmp to TMPDIR=%DJDIR%/tmp Now getenv() & tmpnam() do what I expect: returns "c:/djgpp/tmp/dj10000" (but that only 'fixes' TMPDIR, no other variable), and now I'm suspicious that there's some weird problem with system()! Look at this: > #include > #include > > int main(void) > { > char *n, buf[80]; > > puts(getenv("TMPDIR")); > puts(n = tmpnam(NULL)); > > sprintf(buf, "dir %s", n); // c:/djgpp/tmp > printf("system(\"%s\")\n", buf); > system(buf); > > return 0; > } with TMPDIR excplicitly set in djgpp.env: > c:/djgpp/tmp > c:/djgpp/tmp/dj500000 > system("dir c:/djgpp/tmp/dj500000") > dir: c\:/djgpp/tmp/dj500000: No such file or directory (ENOENT) ^ wtf? without TMPDIR explicitly set: > c:\djgpp\tmp > c:\djgpp\tmp/dj500000 > system("dir c:\djgpp\tmp/dj500000") > dir: c\:djgpptmp/dj500000: No such file or directory (ENOENT) ^^^ ^ Is dir escaping the backslashes? I thought the shell did that. :\ Baffled. Jeremy