From cf7cab4ede7d84ce110248de1606805b8c593da7 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Tue, 1 Sep 2020 21:35:53 -0400 Subject: set new path to old path in update mode --- multihome.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'multihome.c') diff --git a/multihome.c b/multihome.c index 5715833..77ab821 100644 --- a/multihome.c +++ b/multihome.c @@ -644,7 +644,14 @@ int main(int argc, char *argv[]) { sprintf(multihome.config_init, "%s/init", multihome.config_dir); sprintf(multihome.config_transfer, "%s/transfer", multihome.config_dir); sprintf(multihome.config_skeleton, "%s/skel/", multihome.config_dir); - sprintf(multihome.path_new, "%s/%s/%s", multihome.path_old, multihome.path_root, nodename); + + // Update mode uses the current $HOME, so set .path_new to .path_old + if (arguments.update) { + strcpy(multihome.path_new, multihome.path_old); + } else { // Construct .path_new normally + sprintf(multihome.path_new, "%s/%s/%s", multihome.path_old, multihome.path_root, nodename); + } + sprintf(multihome.path_topdir, "%s/topdir", multihome.path_new); sprintf(multihome.marker, "%s/.multihome_controlled", multihome.path_new); -- cgit