[vlc-devel] commit: input_item_SetURI(): add a NDEBUG printf check for paths. ( Derk-Jan Hartman )

git version control git at videolan.org
Wed Jun 24 16:24:00 CEST 2009


vlc | branch: master | Derk-Jan Hartman <hartman at videolan.org> | Wed Jun 24 16:22:29 2009 +0200| [69d1ac0a4b2238be242184ceeac92b5b6f623368] | committer: Derk-Jan Hartman 

input_item_SetURI(): add a NDEBUG printf check for paths.

When it is called with strings that contain " " or '\' or don't have ://, we have an indication that the caller is likely providing a path. This will help us find these cases in the future.

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

 src/input/item.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/input/item.c b/src/input/item.c
index 73f7d37..0d2e691 100644
--- a/src/input/item.c
+++ b/src/input/item.c
@@ -353,6 +353,10 @@ char *input_item_GetURI( input_item_t *p_i )
 void input_item_SetURI( input_item_t *p_i, const char *psz_uri )
 {
     vlc_mutex_lock( &p_i->lock );
+#ifndef NDEBUG
+    if( !strstr( psz_uri, "://" || strstr( psz_uri, " " ) || strstr( psz_uri, "\") ))
+        fprintf( stderr, "input_item_SetURI() was likely called with a path. FIXME\n" );
+#endif
 
     free( p_i->psz_uri );
     p_i->psz_uri = strdup( psz_uri );




More information about the vlc-devel mailing list