# HG changeset patch # User ramiro # Date 1223657977 0 # Node ID 4d5d9ac28e21c9b964380b35b6af0d7626d739d0 # Parent 8c5a32f0d479da41b68eebaf1193c23c490d1430 Only special-case absolute DOS paths on systems that support them. diff -r 8c5a32f0d479 -r 4d5d9ac28e21 avio.c --- a/avio.c Wed Oct 08 20:55:22 2008 +0000 +++ b/avio.c Fri Oct 10 16:59:37 2008 +0000 @@ -21,6 +21,7 @@ #include "libavutil/avstring.h" #include "libavcodec/opt.h" +#include "os_support.h" #include "avformat.h" #if LIBAVFORMAT_VERSION_MAJOR >= 53 @@ -115,7 +116,7 @@ p++; } /* if the protocol has length 1, we consider it is a dos drive */ - if (*p == '\0' || (q - proto_str) <= 1) { + if (*p == '\0' || is_dos_path(filename)) { file_proto: strcpy(proto_str, "file"); } else { diff -r 8c5a32f0d479 -r 4d5d9ac28e21 os_support.h --- a/os_support.h Wed Oct 08 20:55:22 2008 +0000 +++ b/os_support.h Fri Oct 10 16:59:37 2008 +0000 @@ -32,6 +32,15 @@ # define lseek(f,p,w) _lseeki64((f), (p), (w)) #endif +static inline int is_dos_path(const char *path) +{ +#ifdef HAVE_DOS_PATHS + if (path[0] && path[1] == ':') + return 1; +#endif + return 0; +} + #ifdef __BEOS__ # include # include