Use new pathjoin() function.

This commit is contained in:
Wayne Davison
2004-01-20 04:53:59 +00:00
parent 368ad70e05
commit a7725e6df9
2 changed files with 5 additions and 7 deletions

View File

@@ -132,8 +132,7 @@ static int check_one_exclude(char *name, struct exclude_struct *ex,
static char full_name[MAXPATHLEN];
extern char curr_dir[];
int plus = curr_dir[1] == '\0'? 1 : 0;
snprintf(full_name, sizeof full_name,
"%s/%s", curr_dir+plus, name);
pathjoin(full_name, sizeof full_name, curr_dir+plus, name);
name = full_name;
}
@@ -443,10 +442,9 @@ void add_cvs_excludes(void)
for (i=0; cvs_ignore_list[i]; i++)
add_exclude(&exclude_list, cvs_ignore_list[i], ADD_EXCLUDE);
if ((p=getenv("HOME")) && strlen(p) < (MAXPATHLEN-12)) {
snprintf(fname,sizeof(fname), "%s/.cvsignore",p);
add_exclude_file(&exclude_list,fname,MISSING_OK,ADD_EXCLUDE);
}
if ((p = getenv("HOME"))
&& pathjoin(fname, sizeof fname, p, ".cvsignore") < sizeof fname)
add_exclude_file(&exclude_list, fname, MISSING_OK, ADD_EXCLUDE);
add_exclude_line(&exclude_list, getenv("CVSIGNORE"), ADD_EXCLUDE);
}

View File

@@ -93,7 +93,7 @@ int delete_file(char *fname)
if (strcmp(dname,".") == 0
|| strcmp(dname,"..") == 0)
continue;
snprintf(buf, sizeof(buf), "%s/%s", fname, dname);
pathjoin(buf, sizeof buf, fname, dname);
if (verbose > 0)
rprintf(FINFO,"deleting %s\n", buf);
if (delete_file(buf) != 0) {