Skip to content

Commit

Permalink
fixup! Windows: add support for a Windows-wide configuration
Browse files Browse the repository at this point in the history
This fixes #168.

Signed-off-by: Johannes Schindelin <[email protected]>
  • Loading branch information
dscho committed May 29, 2015
1 parent 18583f5 commit d32afb6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions compat/mingw.c
Original file line number Diff line number Diff line change
Expand Up @@ -2665,10 +2665,13 @@ const char *program_data_config(void)

if (!initialized) {
const char *env = mingw_getenv("PROGRAMDATA");
if (!env)
const char *extra = "";
if (!env) {
env = mingw_getenv("ALLUSERSPROFILE");
extra = "/Application Data";
}
if (env)
strbuf_addf(&path, "%s/Git/config", env);
strbuf_addf(&path, "%s%s/Git/config", env, extra);
initialized = 1;
}
return *path.buf ? path.buf : NULL;
Expand Down

0 comments on commit d32afb6

Please sign in to comment.