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

Function full_fname

util1.c:1273–1301  ·  view source on GitHub ↗

* Return a quoted string with the full pathname of the indicated filename. * The string " (in MODNAME)" may also be appended. The returned pointer * remains valid until the next time full_fname() is called. **/

Source from the content-addressed store, hash-verified

1271 * remains valid until the next time full_fname() is called.
1272 **/
1273char *full_fname(const char *fn)
1274{
1275 static char *result = NULL;
1276 char *m1, *m2, *m3;
1277 char *p1, *p2;
1278
1279 if (result)
1280 free(result);
1281
1282 if (*fn == '/')
1283 p1 = p2 = "";
1284 else {
1285 p1 = curr_dir + module_dirlen;
1286 for (p2 = p1; *p2 == '/'; p2++) {}
1287 if (*p2)
1288 p2 = "/";
1289 }
1290 if (module_id >= 0) {
1291 m1 = " (in ";
1292 m2 = lp_name(module_id);
1293 m3 = ")";
1294 } else
1295 m1 = m2 = m3 = "";
1296
1297 if (asprintf(&result, "\"%s%s%s\"%s%s%s", p1, p2, fn, m1, m2, m3) < 0)
1298 out_of_memory("full_fname");
1299
1300 return result;
1301}
1302
1303static char partial_fname[MAXPATHLEN];
1304

Callers 15

send_filesFunction · 0.85
hard_link_checkFunction · 0.85
hard_link_oneFunction · 0.85
finish_hard_linkFunction · 0.85
open_batch_filesFunction · 0.85
push_local_filtersFunction · 0.85
unlink_and_reopenFunction · 0.85
copy_fileFunction · 0.85
copy_valid_pathFunction · 0.85
make_backupFunction · 0.85
set_file_attrsFunction · 0.85
finish_transferFunction · 0.85

Calls 2

lp_nameFunction · 0.85
asprintfFunction · 0.85

Tested by

no test coverage detected