diff options
Diffstat (limited to 'src/cli_new.c')
-rw-r--r-- | src/cli_new.c | 28 |
1 files changed, 28 insertions, 0 deletions
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; |