]> git.ozlabs.org Git - petitboot/blobdiff - discover/paths.c
Add ncurses UI menu
[petitboot] / discover / paths.c
index 72d07b20c4cee09b354510558e4558e405e4b828..8e2a3610bee7b00a163bb15619fa6a36121c0962 100644 (file)
@@ -35,7 +35,7 @@ const char *mount_base(void)
 char *encode_label(void *alloc_ctx, const char *label)
 {
        char *str, *c;
-       int i;
+       unsigned int i;
 
        /* the label can be expanded by up to four times */
        str = talloc_size(alloc_ctx, strlen(label) * 4 + 1);
@@ -116,9 +116,17 @@ const char *mountpoint_for_device(const char *dev)
 
 char *resolve_path(void *alloc_ctx, const char *path, const char *current_dev)
 {
+       static const char s_file[] = "file://";
        char *ret;
        const char *devpath, *sep;
 
+       /* test for urls */
+
+       if (!strncasecmp(path, s_file, sizeof(s_file) - 1))
+               path += sizeof(s_file) - 1;
+       else if (strstr(path, "://"))
+               return talloc_strdup(alloc_ctx, path);
+
        sep = strchr(path, ':');
        if (!sep) {
                devpath = mountpoint_for_device(current_dev);