Mail Archives: djgpp/2002/12/18/01:02:50
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 <stdio.h>
> #include <stdlib.h>
>
> 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
- Raw text -