Mail Archives: djgpp-workers/1999/05/09/15:45:52
Eli,
I'm not sure if I've found a problem or not. Here's a case that produces 
gibberish at the end of the output string when FOO doesn't exist:
/dev/env/FOO~c:/djgpp
I'll admit this case is illegal according to the docs, but I don't think it's 
nice that it produces garbage at the end either.
Here's one way to keep garbage from appearing at the tail:
*** putpath.c.eli	Sun May  9 15:31:18 1999
--- putpath.c	Sun May  9 15:32:52 1999
*************** _put_path2(const char *path, int offset)
*** 107,116 ****
  
        /* if the rest of path begins with a slash, remove the trailing
           slash in the transfer buffer */
!       if ((p[1] == '/' || p[1] == '\\') && o-1 >= __tb+offset
!           && ((c = _farnspeekb(o-1)) == '/' || c == '\\'))
!         o--;
!       path = p + 1;
      }
      else if (p[5])
        path = p + 5;
--- 107,121 ----
  
        /* if the rest of path begins with a slash, remove the trailing
           slash in the transfer buffer */
!       if (*p)
!       {
!         if ((p[1] == '/' || p[1] == '\\') && o-1 >= __tb+offset
!             && ((c = _farnspeekb(o-1)) == '/' || c == '\\'))
!           o--;
!         path = p + 1;
!       }
!       else
!         path = p;
      }
      else if (p[5])
        path = p + 5;
I missed the debate over the delimiter change while working on 
changing my email address, but if it isn't too late I would suggest  " as 
a possible delimiter, as in:
/dev/env/DJDIR"c:/djgpp"/include
Mark
--- 
Mark Elbrecht, snowball3 AT bigfoot DOT com
http://snowball.frogspace.net/
- Raw text -