Mail Archives: djgpp-workers/1999/05/10/00:18:04
> 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
>
I'd be willing to bet there is some problem with using quotes. At any
rate, I've come up with one way to have '~' at the beginning of the
default string and still let '~' be in the variable name too.
If the first character following the delimiter separating the variable
name from the default string is a certain character, ':' for example, then
skip and ignore that character. For example:
/dev/env/djfoo~:~~out.tmp~ would evaluate to '~out.tmp'.
Here's an updated suggested patch for this feature and for solving the
garbage problem:
*** putpath.c.eli Sun May 9 15:31:18 1999
--- putpath.c Mon May 10 00:09:36 1999
*************** _put_path2(const char *path, int offset)
*** 81,86 ****
--- 81,90 ----
}
if (*p == '~') /* use or skip the default value if present */
{
+ /* If the first character is a ':', skip it. This allows
+ the delimiter to be the first character in a default string. */
+ if (p[1] == ':')
+ ++p;
for (++p; *p; p++)
{
if (*p == '~')
*************** _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;
--- 111,129 ----
/* 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
! {
! if ((c = _farnspeekb(o-1)) == '/' || c == '\\')
! o--;
! path = p;
! }
}
else if (p[5])
path = p + 5;
---
Mark Elbrecht, snowball3 AT bigfoot DOT com
http://snowball.frogspace.net/
- Raw text -