MCPcopy Index your code
hub / github.com/RsyncProject/rsync / partial_dir_fname

Function partial_dir_fname

util1.c:1305–1334  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1303static char partial_fname[MAXPATHLEN];
1304
1305char *partial_dir_fname(const char *fname)
1306{
1307 char *t = partial_fname;
1308 int sz = sizeof partial_fname;
1309 const char *fn;
1310
1311 if ((fn = strrchr(fname, '/')) != NULL) {
1312 fn++;
1313 if (*partial_dir != '/') {
1314 int len = fn - fname;
1315 strncpy(t, fname, len); /* safe */
1316 t += len;
1317 sz -= len;
1318 }
1319 } else
1320 fn = fname;
1321 if ((int)pathjoin(t, sz, partial_dir, fn) >= sz)
1322 return NULL;
1323 if (daemon_filter_list.head) {
1324 t = strrchr(partial_fname, '/');
1325 *t = '\0';
1326 if (check_filter(&daemon_filter_list, FLOG, partial_fname, 1) < 0)
1327 return NULL;
1328 *t = '/';
1329 if (check_filter(&daemon_filter_list, FLOG, partial_fname, 0) < 0)
1330 return NULL;
1331 }
1332
1333 return partial_fname;
1334}
1335
1336/* If no --partial-dir option was specified, we don't need to do anything
1337 * (the partial-dir is essentially '.'), so just return success. */

Callers 4

copy_altdest_fileFunction · 0.85
recv_generatorFunction · 0.85
handle_delayed_updatesFunction · 0.85
recv_filesFunction · 0.85

Calls 2

pathjoinFunction · 0.85
check_filterFunction · 0.70

Tested by

no test coverage detected