~nytpu/xdgbasedir.c

4c51f57f1c9b479499fe69956053cc15397322c9 — nytpu 2 months ago 88e4929 master
fix bug when appending to env var
3 files changed, 4 insertions(+), 4 deletions(-)

M README.md
M xdgbasedir.c
M xdgbasedir.h
M README.md => README.md +1 -1
@@ 8,7 8,7 @@ environment variables are set.

See [`xdgbasedir.h`](xdgbasedir.h) for more information.

![version: 1.1.1](https://img.shields.io/badge/version-1.1.1-informational.svg)
![version: 1.1.2](https://img.shields.io/badge/version-1.1.1-informational.svg)
[![license: MPL-2.0](https://img.shields.io/badge/license-MPL--2.0-informational.svg)](LICENSE)



M xdgbasedir.c => xdgbasedir.c +2 -2
@@ 1,4 1,4 @@
// VERSION: 1.1.0
// VERSION: 1.1.2
/* Return directories following the XDG Base Directory Specification.  First
 * searches the "single base directory" environment variables such as
 * $XDG_DATA_HOME.  If that variable doesn't exist or is empty, returns the


@@ 69,7 69,7 @@ get_dir(const char *env_main, const char *fallback)
	// Everything except for runtime dir
	if (fallback != NULL) {
		env = getenv("HOME");
		if (env != NULL) return xdg_append_to_path(env, fallback);
		if (env != NULL) return xdg_append_to_path(strdup(env), fallback);
	}

	return NULL;

M xdgbasedir.h => xdgbasedir.h +1 -1
@@ 1,4 1,4 @@
// VERSION: 1.1.1
// VERSION: 1.1.2
/* Return directories following the XDG Base Directory Specification.  First
 * searches the "single base directory" environment variables such as
 * $XDG_DATA_HOME.  If that variable doesn't exist or is empty, returns the