* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
/*
* handle a plain ~ or ~/ by expanding $HOME
* first and then trying the password file
+ * or $USERPROFILE on DOSISH systems
*/
if ((h = getenv("HOME")) == NULL) {
#ifdef HAS_PASSWD
return pattern;
else
h = pwd->pw_dir;
+#elif DOSISH
+ /*
+ * When no passwd file, fallback to the USERPROFILE
+ * environment variable on DOSish systems.
+ */
+ if ((h = getenv("USERPROFILE")) == NULL) {
+ return pattern;
+ }
#else
return pattern;
#endif
/*
- * Extend the gl_pathv member of a glob_t structure to accomodate a new item,
+ * Extend the gl_pathv member of a glob_t structure to accommodate a new item,
* add the new item, and update gl_pathc.
*
* This assumes the BSD realloc, which only copies the block when its size