patch fix.

This commit is contained in:
Gwyn Ciesla 2019-04-01 11:10:35 -05:00
parent bc9dd3c808
commit 373005e21f
2 changed files with 18 additions and 20 deletions

View File

@ -1,8 +1,6 @@
diff --git a/src/basedir.c b/src/basedir.c --- a/src/basedir.c 2019-04-01 17:11:52.293770606 +0200
index 68ab879..417d270 100644 +++ b/src/basedir.c 2019-04-01 14:03:23.465154736 +0200
--- a/src/basedir.c @@ -142,26 +142,22 @@
+++ b/src/basedir.c
@@ -142,21 +142,18 @@ static void xdgFreeStringList(char** list)
/** Free all data in the cache and set pointers to null. */ /** Free all data in the cache and set pointers to null. */
static void xdgFreeData(xdgCachedData *cache) static void xdgFreeData(xdgCachedData *cache)
{ {
@ -27,14 +25,13 @@ index 68ab879..417d270 100644
free(cache->cacheHome); free(cache->cacheHome);
cache->cacheHome = 0; cache->cacheHome = 0;
} }
if (cache->runtimeDirectory) { - if (cache->runtimeDirectory)
- {
+ if (cache->runtimeDirectory) {
free(cache->runtimeDirectory); free(cache->runtimeDirectory);
cache->runtimeDirectory = 0; cache->runtimeDirectory = 0;
} }
xdgFreeStringList(cache->searchableDataDirectories); @@ -327,8 +323,12 @@
cache->searchableDataDirectories = 0;
xdgFreeStringList(cache->searchableConfigDirectories);
@@ -322,8 +323,12 @@ static int xdgUpdateHomeDirectories(xdgCachedData* cache)
if (cache->dataHome && cache->configHome && cache->cacheHome) return TRUE; if (cache->dataHome && cache->configHome && cache->cacheHome) return TRUE;
@ -49,7 +46,7 @@ index 68ab879..417d270 100644
/* Allocate maximum needed for any of the 3 default values */ /* Allocate maximum needed for any of the 3 default values */
if (!(value = (char*)malloc((homelen = strlen(homeenv))+extralen))) return FALSE; if (!(value = (char*)malloc((homelen = strlen(homeenv))+extralen))) return FALSE;
@@ -609,8 +614,8 @@ const char * const * xdgSearchableDataDirectories(xdgHandle *handle) @@ -614,8 +614,8 @@
else else
{ {
char *datahome = (char*)xdgDataHome(NULL); char *datahome = (char*)xdgDataHome(NULL);
@ -60,7 +57,7 @@ index 68ab879..417d270 100644
free(datahome); free(datahome);
return (const char * const *)datadirs; return (const char * const *)datadirs;
} }
@@ -629,8 +634,8 @@ const char * const * xdgSearchableConfigDirectories(xdgHandle *handle) @@ -634,8 +634,8 @@
else else
{ {
char *confighome = (char*)xdgConfigHome(NULL); char *confighome = (char*)xdgConfigHome(NULL);
@ -71,10 +68,8 @@ index 68ab879..417d270 100644
free(confighome); free(confighome);
return (const char * const *)configdirs; return (const char * const *)configdirs;
} }
diff --git a/tests/testdump.c b/tests/testdump.c --- a/tests/testdump.c 2012-01-22 02:29:11.000000000 +0100
index 2e6e0fb..9b0ce9a 100644 +++ b/tests/testdump.c 2019-04-01 14:03:23.463154767 +0200
--- a/tests/testdump.c
+++ b/tests/testdump.c
@@ -24,27 +24,56 @@ @@ -24,27 +24,56 @@
#include <basedir.h> #include <basedir.h>

View File

@ -1,6 +1,6 @@
Name: libxdg-basedir Name: libxdg-basedir
Version: 1.2.0 Version: 1.2.0
Release: 18%{?dist} Release: 19%{?dist}
Summary: Implementation of the XDG Base Directory Specifications Summary: Implementation of the XDG Base Directory Specifications
License: MIT License: MIT
@ -81,6 +81,9 @@ make check USE_VALGRIND=1
%doc doc/html/ %doc doc/html/
%changelog %changelog
* Mon Apr 01 2019 Gwyn Ciesla <gwync@protonmail.com> - 1.2.0-19
- Patch correction.
* Mon Apr 01 2019 Gwyn Ciesla <gwync@protonmail.com> - 1.2.0-18 * Mon Apr 01 2019 Gwyn Ciesla <gwync@protonmail.com> - 1.2.0-18
- Patch to handle undefined homedir, BZ 1694706. - Patch to handle undefined homedir, BZ 1694706.