break;
}
- case '+': /* This is HTTP forms, not URI decoding... */
- *out++ = ' ';
- break;
-
default:
/* Inserting non-ASCII or non-printable characters is unsafe,
* and no sane browser will send these unencoded */
if( p_item && p_item->p_stats )
{
vlc_mutex_lock( &p_item->p_stats->lock );
- snprintf( buf, 10, "%d",
+ snprintf( buf, 10, "%"PRIi64,
p_item->p_stats->i_displayed_pictures );
vlc_mutex_unlock( &p_item->p_stats->lock );
}
case 'B':
if( p_input )
{
- snprintf( buf, 10, "%d",
+ snprintf( buf, 10, "%"PRId64,
var_GetInteger( p_input, "bit-rate" )/1000 );
}
else
case 'C':
if( p_input )
{
- snprintf( buf, 10, "%d",
+ snprintf( buf, 10, "%"PRId64,
var_GetInteger( p_input, "chapter" ) );
}
else
case 'I':
if( p_input )
{
- snprintf( buf, 10, "%d",
+ snprintf( buf, 10, "%"PRId64,
var_GetInteger( p_input, "title" ) );
}
else
}
#include <vlc_url.h>
+#ifdef WIN32
+# include <io.h>
+#endif
/**
* Convert a file path to an URI.
char *buf;
#ifdef WIN32
+ /* Drive letter */
if (isalpha (path[0]) && (path[1] == ':'))
{
- if (asprintf (&buf, "%s:///%c:", scheme, path[0]) == -1)
+ if (asprintf (&buf, "%s:///%c:", scheme ? scheme : "file",
+ path[0]) == -1)
buf = NULL;
path += 2;
+# warning Drive letter-relative path not implemented!
+ if (path[0] != DIR_SEP_CHAR)
+ return NULL;
}
else
#endif
snprintf (buf, sizeof (SMB_SCHEME) + 3 + hostlen,
SMB_SCHEME"://%s", path + 2);
path += 2 + hostlen;
+
+ if (path[0] == '\0')
+ return buf; /* Hostname without path */
}
else
if (path[0] != DIR_SEP_CHAR)