]> git.ozlabs.org Git - petitboot/blobdiff - ui/common/loader.c
lib/url: Move URL-handling code to lib
[petitboot] / ui / common / loader.c
index 775f2111c281b25381906dc95c8c79b88087c446..b3ae7659b327a88813d229c48e7bd5e2fb7698f5 100644 (file)
@@ -26,9 +26,9 @@
 
 #include "log/log.h"
 #include <system/system.h>
+#include <url/url.h>
 #include "talloc/talloc.h"
 #include "loader.h"
-#include "url.h"
 
 
 /**
@@ -122,7 +122,7 @@ fail:
 static char *pb_load_sftp(void *ctx, struct pb_url __attribute__((unused)) *url)
 {
        int result;
-       const char *argv[5];
+       const char *argv[4];
        const char **p;
        char *local;
 
@@ -132,11 +132,10 @@ static char *pb_load_sftp(void *ctx, struct pb_url __attribute__((unused)) *url)
                return NULL;
 
        p = argv;
-       *p++ = pb_system_apps.sftp;     /* 1 */
-       *p++ = url->host;               /* 2 */
-       *p++ = url->path;               /* 3 */
-       *p++ = local;                   /* 4 */
-       *p++ = NULL;                    /* 5 */
+       *p++ = pb_system_apps.sftp;                                     /* 1 */
+       *p++ = talloc_asprintf(local, "%s:%s", url->host, url->path);   /* 2 */
+       *p++ = local;                                                   /* 3 */
+       *p++ = NULL;                                                    /* 4 */
 
        result = pb_run_cmd(argv, 1, 0);