diff options
| author | Wayne Davison <wayned@samba.org> | 2005-02-23 02:56:42 +0000 |
|---|---|---|
| committer | Wayne Davison <wayned@samba.org> | 2005-02-23 02:56:42 +0000 |
| commit | bc83274ad67fe65b3bd42691e46111bf2b5a41dd (patch) | |
| tree | 3f298e94f3918c409dbaeaa292ea4e0759682a59 /util.c | |
| parent | 38e3910b6f37eab2156496d1c4837c306235e9c7 (diff) | |
| download | android_external_rsync-bc83274ad67fe65b3bd42691e46111bf2b5a41dd.tar.gz android_external_rsync-bc83274ad67fe65b3bd42691e46111bf2b5a41dd.tar.bz2 android_external_rsync-bc83274ad67fe65b3bd42691e46111bf2b5a41dd.zip | |
- Fixed a problem with full_fname() when curr_dir was "/".
- Made full_fname() consistently output a leading "/" for
module paths no matter if chroot is in use or not.
Diffstat (limited to 'util.c')
| -rw-r--r-- | util.c | 12 |
1 files changed, 4 insertions, 8 deletions
@@ -922,25 +922,21 @@ char *full_fname(const char *fn) p1 = p2 = ""; else { p1 = curr_dir; - p2 = "/"; + for (p2 = p1; *p2 == '/'; p2++) {} + if (*p2) + p2 = "/"; } if (module_id >= 0) { m1 = " (in "; m2 = lp_name(module_id); m3 = ")"; - if (*p1) { + if (p1 == curr_dir) { if (!lp_use_chroot(module_id)) { char *p = lp_path(module_id); if (*p != '/' || p[1]) p1 += strlen(p); } - if (!*p1) - p2++; - else - p1++; } - else - fn++; } else m1 = m2 = m3 = ""; |
