+static void
+print_febootstrap_command_line (guestfs_h *g, const char *argv[])
+{
+ int i;
+ int needs_quote;
+ char *buf;
+ size_t len;
+
+ /* Calculate length of the buffer needed. This is an overestimate. */
+ len = 0;
+ for (i = 0; argv[i] != NULL; ++i)
+ len += strlen (argv[i]) + 32;
+
+ buf = malloc (len);
+ if (buf == NULL) {
+ warning (g, "malloc: %m");
+ return;
+ }
+
+ len = 0;
+ for (i = 0; argv[i] != NULL; ++i) {
+ if (i > 0) {
+ strcpy (&buf[len], " ");
+ len++;
+ }
+
+ /* Does it need shell quoting? This only deals with simple cases. */
+ needs_quote = strcspn (argv[i], " ") != strlen (argv[i]);
+
+ if (needs_quote) {
+ strcpy (&buf[len], "'");
+ len++;
+ }
+
+ strcpy (&buf[len], argv[i]);
+ len += strlen (argv[i]);
+
+ if (needs_quote) {
+ strcpy (&buf[len], "'");
+ len++;
+ }
+ }
+
+ guestfs___print_timestamped_message (g, "%s", buf);
+
+ free (buf);
+}
+