*/
#include "config.h"
+#include "wine/port.h"
#include <stdio.h>
#include <stdarg.h>
*
* The paths are guaranteed to start with '/'
*/
-const char *XDG_GetPath(int path_id)
+static const char *XDG_GetPath(int path_id)
{
if (path_id >= PATHS_COUNT || path_id < 0)
{
* [in/out] p_ptr - pointer to where we are in the buffer
* Returns the index to xdg_dirs if we find the key, or -1 on error.
*/
-static int parse_config1(const char ** xdg_dirs, const unsigned int num_dirs, char ** p_ptr)
+static int parse_config1(const char * const *xdg_dirs, const unsigned int num_dirs, char ** p_ptr)
{
char *p;
int i;
* [in] num_dirs - number of elements in xdg_dirs
* [out] out_ptr - an array of the xdg directories names
*/
-HRESULT XDG_UserDirLookup(const char ** xdg_dirs, const unsigned int num_dirs, char *** out_ptr)
+HRESULT XDG_UserDirLookup(const char * const *xdg_dirs, const unsigned int num_dirs, char *** out_ptr)
{
FILE *file;
char **out;
char *home_dir, *config_file;
char buffer[512];
- int i, len;
+ int len;
+ unsigned int i;
HRESULT hr;
*out_ptr = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, num_dirs * sizeof(char *));
continue;
}
}
+ fclose (file);
hr = S_OK;
/* Remove entries for directories that do not exist */
if (FAILED(hr))
{
for (i = 0; i < num_dirs; i++) HeapFree(GetProcessHeap(), 0, out[i]);
- HeapFree(GetProcessHeap(), 0, out_ptr);
+ HeapFree(GetProcessHeap(), 0, *out_ptr);
}
return hr;
}