<commit_before>#include "../system.h"
#include "../sccs.h"

/*
 * Copyright (c) 2001 <NAME>       All rights reserved.
 */

#ifdef WIN32
char *
getHomeDir()
{
        char	*homeDir, *t;
	char	home_buf[MAXPATH], tmp[MAXPATH];
	int	len = MAXPATH;
#define KEY "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders"

        homeDir = getenv("HOME");
        if (homeDir == NULL) {
		if (!getReg(KEY, "AppData", home_buf, &len)) return (NULL);
		GetShortPathName(home_buf, tmp, MAXPATH);
		localName2bkName(home_buf, home_buf);
		concat_path(tmp, tmp, "BitKeeper");
		unless (exists(tmp)) mkdir(tmp, 0640);
                homeDir = strdup(tmp);
        } else {
		GetShortPathName(homeDir, tmp, MAXPATH);
		homeDir = strdup(tmp);
		localName2bkName(homeDir, homeDir);
	}
        return homeDir;
}
#else
char *
getHomeDir()
{
        char *homeDir;

        homeDir = getenv("HOME");
	if (homeDir) homeDir = strdup(homeDir);
        return homeDir;
}
#endif
<commit_msg>On win32, always compute the home directory via the registry. This make it consistent with our tcl gui.<commit_after>#include "../system.h"
#include "../sccs.h"

/*
 * Copyright (c) 2001 <NAME>       All rights reserved.
 */

#ifdef WIN32
char *
getHomeDir()
{
        char	*homeDir, *t;
	char	home_buf[MAXPATH], tmp[MAXPATH];
	int	len = MAXPATH;
#define KEY "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders"

	if (!getReg(KEY, "AppData", home_buf, &len)) return (NULL);
	GetShortPathName(home_buf, tmp, MAXPATH);
	localName2bkName(home_buf, home_buf);
	concat_path(tmp, tmp, "BitKeeper");
	unless (exists(tmp)) mkdir(tmp, 0640);
	homeDir = strdup(tmp);
        return homeDir;
}
#else
char *
getHomeDir()
{
        char *homeDir;

        homeDir = getenv("HOME");
	if (homeDir) homeDir = strdup(homeDir);
        return homeDir;
}
#endif

{'fraction_non_alphanumeric': 0.14959349593495935, 'fraction_numerical': 0.013550135501355014, 'mean_word_length': 3.491484184914842, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '772498', 'n_tokens_mistral': 695, 'n_tokens_neox': 651, 'n_words': 160}