Clean up.
authorLaurent Aimar <fenrir@videolan.org>
Mon, 29 Jun 2009 20:33:59 +0000 (22:33 +0200)
committerLaurent Aimar <fenrir@videolan.org>
Wed, 1 Jul 2009 19:24:35 +0000 (21:24 +0200)
src/input/input.c

index d9133b1..9232848 100644 (file)
@@ -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, '#' );