]> git.sesse.net Git - vlc/blobdiff - src/misc/modules.c
* String review, round one
[vlc] / src / misc / modules.c
index 34c0b1bdc6134c573e03ea198b1d25a54216269b..5046059eb0a9f038fc0f53e03dcb816238ce7877 100644 (file)
@@ -1,8 +1,8 @@
 /*****************************************************************************
  * modules.c : Builtin and plugin modules management functions
  *****************************************************************************
- * Copyright (C) 2001 VideoLAN
- * $Id: modules.c,v 1.139 2003/11/19 10:17:51 gbazin Exp $
+ * Copyright (C) 2001-2004 VideoLAN
+ * $Id: modules.c,v 1.144 2004/01/25 17:16:06 zorglub Exp $
  *
  * Authors: Sam Hocevar <sam@zoy.org>
  *          Ethan C. Baldridge <BaldridgeE@cadmus.com>
@@ -99,7 +99,6 @@
 #include "aout_internal.h"
 
 #include "stream_output.h"
-/*#include "announce.h"*/
 #include "osd.h"
 
 #include "iso_lang.h"
 #else
 #    include "modules_builtin.h"
 #endif
+#include "network.h"
 
 /*****************************************************************************
  * Local prototypes
@@ -678,7 +678,7 @@ static void AllocatePluginDir( vlc_object_t *p_this, const MYCHAR *psz_dir,
     struct dirent * file;
 #endif
 
-    if( i_maxdepth < 0 )
+    if( p_this->p_vlc->b_die || i_maxdepth < 0 )
     {
         return;
     }
@@ -738,7 +738,7 @@ static void AllocatePluginDir( vlc_object_t *p_this, const MYCHAR *psz_dir,
             AllocatePluginFile( p_this, psz_path );
         }
     }
-    while( FindNextFile( handle, &finddata ) );
+    while( !p_this->p_vlc->b_die && FindNextFile( handle, &finddata ) );
 
     /* Close the directory */
     FindClose( handle );
@@ -753,7 +753,7 @@ static void AllocatePluginDir( vlc_object_t *p_this, const MYCHAR *psz_dir,
     i_dirlen = strlen( psz_dir );
 
     /* Parse the directory and try to load all files it contains. */
-    while( (file = readdir( dir )) )
+    while( !p_this->p_vlc->b_die && (file = readdir( dir )) )
     {
         struct stat statbuf;
         unsigned int i_len;
@@ -862,13 +862,12 @@ static int AllocatePluginFile( vlc_object_t * p_this, MYCHAR * psz_file )
     }
 
 #elif defined(HAVE_DL_WINDOWS) && defined(WIN32)
-    char psz_filename[MAX_PATH];
     handle = LoadLibrary( psz_file );
     if( handle == NULL )
     {
         char *psz_error = GetWindowsError();
         msg_Warn( p_this, "cannot load module `%s' (%s)",
-                          psz_filename, psz_error );
+                          psz_file, psz_error );
         free( psz_error );
     }