[vlc-devel] commit: Clean up. (Laurent Aimar )

git version control git at videolan.org
Wed Jul 1 21:28:56 CEST 2009


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Mon Jun 29 22:33:59 2009 +0200| [967845de92c7bb87e37984fdf025de62bac4ffb1] | committer: Laurent Aimar 

Clean up.

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

 src/input/input.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/input/input.c b/src/input/input.c
index d9133b1..9232848 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -2359,17 +2359,16 @@ static int InputSourceInit( input_thread_t *p_input,
 #endif
           )
         {   /* host specified -> only localhost is supported */
-            static const unsigned localhostLen = 9; /* strlen("localhost") */
-            if (!strncmp( psz_path, "localhost" DIR_SEP, localhostLen + 1))
-                psz_path += localhostLen;
-            else
+            static const size_t i_localhost = sizeof("localhost")-1;
+            if( strncmp( psz_path, "localhost" DIR_SEP, i_localhost + 1) != 0 )
             {
                 msg_Err( p_input, "cannot open remote file `%s://%s'",
-                        psz_access, psz_path );
-                msg_Info( p_input, "Did you mean `%s:///%s'?",
                          psz_access, psz_path );
+                msg_Info( p_input, "Did you mean `%s:///%s'?",
+                          psz_access, psz_path );
                 goto error;
             }
+            psz_path += i_localhost;
         }
         /* Remove HTML anchor if present (not supported). */
         char *p = strchr( psz_path, '#' );




More information about the vlc-devel mailing list