Revision 6e96e88ae43e8c78ec0066b0ee87d53987b14098 authored by Junio C Hamano on 27 August 2018, 21:33:42 UTC, committed by Junio C Hamano on 27 August 2018, 21:33:42 UTC
"git help --config" (which is used in command line completion)
missed the configuration variables not described in the main
config.txt file but are described in another file that is included
by it, which has been corrected.

* nd/complete-config-vars:
  generate-cmdlist.sh: collect config from all config.txt files
2 parent s 7ae96e3 + eb90ea7
Raw File
mkdir.c
#include "../git-compat-util.h"
#undef mkdir

/* for platforms that can't deal with a trailing '/' */
int compat_mkdir_wo_trailing_slash(const char *dir, mode_t mode)
{
	int retval;
	char *tmp_dir = NULL;
	size_t len = strlen(dir);

	if (len && dir[len-1] == '/') {
		if ((tmp_dir = strdup(dir)) == NULL)
			return -1;
		tmp_dir[len-1] = '\0';
	}
	else
		tmp_dir = (char *)dir;

	retval = mkdir(tmp_dir, mode);
	if (tmp_dir != dir)
		free(tmp_dir);

	return retval;
}
back to top