From 93a148a78b577ced2cfaebdbe1659e3ecc58c4aa Mon Sep 17 00:00:00 2001 From: Michael Larson Date: Mon, 7 Jul 2008 12:05:27 -0700 Subject: fix for bug 3216. added no escape option to push path for environmental path variable. note this is appied to all c code access to the edit env variable. --- src/cli_new.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src/cli_new.c') diff --git a/src/cli_new.c b/src/cli_new.c index b66d83c..0b50ccb 100644 --- a/src/cli_new.c +++ b/src/cli_new.c @@ -1774,7 +1774,35 @@ void push_path(vtw_path *path, char *segm) }else *pp = *cp; *pp = 0; + path->path_len += len; + if (path->path_lev == path->path_ends_alloc){ + path->path_ends_alloc += ENDS_ALLOC; + path->path_ends = (int *)my_realloc(path->path_ends, + sizeof(int *)*path->path_ends_alloc, "puhs_path 2"); + } + path->path_ends[path->path_lev++] = path->path_len; + // push_path_no_escape(); +} +/** + * Version of above that doesn't escape value before stuffing. + * + **/ +void push_path_no_escape(vtw_path *path, char *segm) +{ + int len; + char *cp; + char *pp; + + for(cp=segm, len=0;*cp;++cp, ++len); + warrant_path(path, len + 1); + path->path_buf[path->path_len] = '/'; + path->path_buf[++path->path_len] = 0; + for(pp=path->path_buf + path->path_len,cp=segm; + *cp;++cp, ++pp) { + *pp = *cp; + } + *pp = 0; path->path_len += len; if (path->path_lev == path->path_ends_alloc){ path->path_ends_alloc += ENDS_ALLOC; -- cgit v1.2.3