[vlc-devel] commit: Revert "Win32: fix #2592 (stdin file input). It may impact other platforms, so please test, and fix/ revert if you see a bug." ( Rémi Denis-Courmont )

git version control git at videolan.org
Sat Dec 26 19:01:26 CET 2009


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Dec 26 19:59:02 2009 +0200| [eeff52c80e2c3321b8de8e358ba41af65309d2be] | committer: Rémi Denis-Courmont 

Revert "Win32: fix #2592 (stdin file input). It may impact other platforms, so please test, and fix/revert if you see a bug."

This reverts commit e33a82dbd7ef005de310f67f7cc83a1bf0c71269.
This broke opening any file starting with a dash.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=eeff52c80e2c3321b8de8e358ba41af65309d2be
---

 src/text/strings.c |   30 +++++++++---------------------
 1 files changed, 9 insertions(+), 21 deletions(-)

diff --git a/src/text/strings.c b/src/text/strings.c
index b69c9e5..09c4ed1 100644
--- a/src/text/strings.c
+++ b/src/text/strings.c
@@ -1100,28 +1100,16 @@ char *make_URI (const char *path)
     }
     else
     if (path[0] != DIR_SEP_CHAR)
-    {
-        if(path[0] == '-')
-        {
-            /*reading from stdin*/
-            if (asprintf (&buf, "-") == -1)
-                return NULL;
-
-            return buf;
-        }
-        else
-        {
-            /* Relative path: prepend the current working directory */
-            char cwd[PATH_MAX];
+    {   /* Relative path: prepend the current working directory */
+        char cwd[PATH_MAX];
 
-            if (getcwd (cwd, sizeof (cwd)) == NULL) /* FIXME: UTF8? */
-                return NULL;
-            if (asprintf (&buf, "%s/%s", cwd, path) == -1)
-                return NULL;
-            char *ret = make_URI (buf);
-            free (buf);
-            return ret;
-        }
+        if (getcwd (cwd, sizeof (cwd)) == NULL) /* FIXME: UTF8? */
+            return NULL;
+        if (asprintf (&buf, "%s/%s", cwd, path) == -1)
+            return NULL;
+        char *ret = make_URI (buf);
+        free (buf);
+        return ret;
     }
     else
         buf = strdup ("file://");




More information about the vlc-devel mailing list