Copied the -h logic from setup.c to sendcommand.c
[citadel.git] / citadel / utils / sendcommand.c
index fde3d5c3c5dff8e39aee0fe6ca9f086e5c32b8a5..bef37c7be7dccc6e51b422e9828e808c11d3fdac 100644 (file)
@@ -153,7 +153,13 @@ int main(int argc, char **argv)
        while ((a = getopt(argc, argv, "h:w:")) != EOF) {
                switch (a) {
                case 'h':
-                       strcpy(relhome, optarg);
+                       relh=optarg[0]!='/';
+                       if (!relh) {
+                               strncpy(ctdl_home_directory, optarg, sizeof ctdl_home_directory);
+                       } else {
+                               strncpy(relhome, optarg, sizeof relhome);
+                       }
+                       home = 1;
                        break;
                case 'w':
                        watchdog = atoi(optarg);