diff options
| author | Wayne Davison <wayned@samba.org> | 2006-10-08 20:56:52 +0000 |
|---|---|---|
| committer | Wayne Davison <wayned@samba.org> | 2006-10-08 20:56:52 +0000 |
| commit | ba081be327dac7fe6018ee4f14e9b07ace99ac73 (patch) | |
| tree | b0b58e33eb0ee983a36ee311a01e9c951d84a7a5 /util.c | |
| parent | 3e88414e4e01e18eff080fc14f1359e37f5d99fe (diff) | |
| download | android_external_rsync-ba081be327dac7fe6018ee4f14e9b07ace99ac73.tar.gz android_external_rsync-ba081be327dac7fe6018ee4f14e9b07ace99ac73.tar.bz2 android_external_rsync-ba081be327dac7fe6018ee4f14e9b07ace99ac73.zip | |
Made the push_dir() function take an option to skip the actual chdir()
call. Used when the dest-dir doesn't exist and --dry-run was specified.
Diffstat (limited to 'util.c')
| -rw-r--r-- | util.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -944,7 +944,7 @@ void die_on_unsafe_path(char *path, int strip_filename) /* Like chdir(), but it keeps track of the current directory (in the * global "curr_dir"), and ensures that the path size doesn't overflow. * Also cleans the path using the clean_fname() function. */ -int push_dir(char *dir) +int push_dir(char *dir, int set_path_only) { static int initialised; unsigned int len; @@ -965,7 +965,7 @@ int push_dir(char *dir) if ((*dir == '/' ? len : curr_dir_len + 1 + len) >= sizeof curr_dir) return 0; - if (chdir(dir)) + if (!set_path_only && chdir(dir)) return 0; if (*dir == '/') { |
