]> git.sesse.net Git - vlc/blobdiff - src/text/strings.c
Use var_Inherit* instead of var_CreateGet*.
[vlc] / src / text / strings.c
index 0a3147402a0f9d4a49c34fbe3096d2bad2a14767..096f72df58709d9487d07524361dbf7d393b7fc9 100644 (file)
@@ -95,10 +95,6 @@ char *decode_URI( char *psz )
                 break;
             }
 
-            case '+': /* This is HTTP forms, not URI decoding... */
-                *out++ = ' ';
-                break;
-
             default:
                 /* Inserting non-ASCII or non-printable characters is unsafe,
                  * and no sane browser will send these unencoded */
@@ -695,7 +691,7 @@ char *str_format_meta( vlc_object_t *p_object, const char *string )
                     if( p_item && p_item->p_stats )
                     {
                         vlc_mutex_lock( &p_item->p_stats->lock );
-                        snprintf( buf, 10, "%d",
+                        snprintf( buf, 10, "%"PRIi64,
                                   p_item->p_stats->i_displayed_pictures );
                         vlc_mutex_unlock( &p_item->p_stats->lock );
                     }
@@ -1030,6 +1026,9 @@ void path_sanitize( char *str )
 }
 
 #include <vlc_url.h>
+#ifdef WIN32
+# include <io.h>
+#endif
 
 /**
  * Convert a file path to an URI.
@@ -1052,11 +1051,16 @@ char *make_URI (const char *path, const char *scheme)
 
     char *buf;
 #ifdef WIN32
+    /* Drive letter */
     if (isalpha (path[0]) && (path[1] == ':'))
     {
-        if (asprintf (&buf, "%s:///%c:", scheme, path[0]) == -1)
+        if (asprintf (&buf, "%s:///%c:", scheme ? scheme : "file",
+                      path[0]) == -1)
             buf = NULL;
         path += 2;
+# warning Drive letter-relative path not implemented!
+        if (path[0] != DIR_SEP_CHAR)
+            return NULL;
     }
     else
 #endif
@@ -1092,6 +1096,9 @@ char *make_URI (const char *path, const char *scheme)
             snprintf (buf, sizeof (SMB_SCHEME) + 3 + hostlen,
                       SMB_SCHEME"://%s", path + 2);
         path += 2 + hostlen;
+
+        if (path[0] == '\0')
+            return buf; /* Hostname without path */
     }
     else
     if (path[0] != DIR_SEP_CHAR)