Commit 2c50013e authored by Christophe Massiot's avatar Christophe Massiot

* modules/control/http.c: Add an 'ext' field to file structures in

   order to get the file extension.
parent 52267cfe
......@@ -1191,6 +1191,7 @@ static mvar_t *mvar_FileSetNew( char *name, char *psz_dir )
for( ;; )
{
mvar_t *f;
const char *psz_ext;
/* parse psz_src dir */
if( ( p_dir_content = readdir( p_dir ) ) == NULL )
......@@ -1214,6 +1215,10 @@ static mvar_t *mvar_FileSetNew( char *name, char *psz_dir )
mvar_AppendNewVar( f, "name", tmp );
mvar_AppendNewVar( f, "basename", p_dir_content->d_name );
/* put file extension in 'ext' */
psz_ext = strrchr( p_dir_content->d_name, '.' );
mvar_AppendNewVar( f, "ext", psz_ext != NULL ? psz_ext + 1 : "" );
#ifdef HAVE_SYS_STAT_H
if( S_ISDIR( stat_info.st_mode ) )
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment