Commit 8f84c018 authored by Ed "oddsock" Zaleski's avatar Ed "oddsock" Zaleski

some win32-isms

and a bad free that valgrind yelled at me about

svn path=/trunk/icecast/; revision=4711
parent ddfae103
......@@ -20,6 +20,9 @@
#include "format_mp3.h"
#include "logging.h"
#ifdef _WIN32
#define snprintf _snprintf
#endif
#define CATMODULE "admin"
......
......@@ -644,7 +644,7 @@ static void _parse_paths(xmlDocPtr doc, xmlNodePtr node,
if(configuration->webroot_dir[strlen(configuration->webroot_dir)-1] == '/')
configuration->webroot_dir[strlen(configuration->webroot_dir)-1] = 0;
} else if (strcmp(node->name, "adminroot") == 0) {
if (configuration->adminroot_dir && configuration->adminroot_dir != CONFIG_DEFAULT_WEBROOT_DIR)
if (configuration->adminroot_dir && configuration->adminroot_dir != CONFIG_DEFAULT_ADMINROOT_DIR)
xmlFree(configuration->adminroot_dir);
configuration->adminroot_dir = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
if(configuration->adminroot_dir[strlen(configuration->adminroot_dir)-1] == '/')
......
......@@ -726,7 +726,11 @@ static void _handle_get_request(connection_t *con,
return;
}
else if(fileserve && stat(fullpath, &statbuf) == 0 &&
#ifdef _WIN32
(statbuf.st_mode == S_IFREG))
#else
S_ISREG(statbuf.st_mode))
#endif
{
fserve_client_create(client, fullpath);
free(fullpath);
......
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