summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/uinfo.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/uinfo.cc')
-rw-r--r--winsup/cygwin/uinfo.cc22
1 files changed, 22 insertions, 0 deletions
diff --git a/winsup/cygwin/uinfo.cc b/winsup/cygwin/uinfo.cc
index 757ca2000..6fca2fde8 100644
--- a/winsup/cygwin/uinfo.cc
+++ b/winsup/cygwin/uinfo.cc
@@ -449,6 +449,28 @@ cygheap_user::env_name (const char *name, size_t namelen)
return pwinname;
}
+const char *
+cygheap_user::env_systemroot (const char *name, size_t namelen)
+{
+ if (!psystemroot)
+ {
+ int size = GetWindowsDirectory (NULL, 0);
+ if (size > 0)
+ {
+ psystemroot = (char *) cmalloc (HEAP_STR, ++size);
+ size = GetWindowsDirectory (psystemroot, size);
+ if (size <= 0)
+ {
+ cfree (psystemroot);
+ psystemroot = NULL;
+ }
+ }
+ if (size <= 0)
+ debug_printf ("GetWindowsDirectory(), %E");
+ }
+ return psystemroot;
+}
+
char *
pwdgrp::next_str (char c)
{