--- a/Win32OS.st Thu Mar 25 00:02:53 1999 +0100
+++ b/Win32OS.st Thu Mar 25 17:02:17 1999 +0100
@@ -4371,9 +4371,6 @@
%{ /* NOCONTEXT */
char *env;
-#ifndef __BORLANDC__
- extern char *getenv();
-#endif
if (__isString(aStringOrSymbol) || __isSymbol(aStringOrSymbol)) {
char buff[512];
@@ -5832,7 +5829,19 @@
"return the name of the users home directory
(i.e. yours)"
- ^ OperatingSystem getEnvironment:'HOME'
+ |dir drv path|
+
+ dir := self getEnvironment:'HOME'.
+ dir isNil ifTrue:[
+ "/ for NT users:
+ "/ if HOME is nil, try HOMEDRIVE and HOMEPATH
+ "/
+ ((drv := self getEnvironment:'HOMEDRIVE') notNil
+ and:[(path := self getEnvironment:'HOMEPATH') notNil]) ifTrue:[
+ dir := drv , path
+ ]
+ ].
+ ^ dir
"
OperatingSystem getHomeDirectory
@@ -5851,7 +5860,6 @@
static firstCall = 1;
#ifndef __BORLANDC__
extern char *getenv();
- extern char *getlogin();
#endif
char *name = (char *)0;
@@ -6680,6 +6688,6 @@
!Win32OperatingSystem class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/Attic/Win32OS.st,v 1.39 1999-03-13 12:20:37 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/Attic/Win32OS.st,v 1.40 1999-03-25 16:02:17 cg Exp $'
! !
Win32OperatingSystem initialize!
--- a/Win32OperatingSystem.st Thu Mar 25 00:02:53 1999 +0100
+++ b/Win32OperatingSystem.st Thu Mar 25 17:02:17 1999 +0100
@@ -4371,9 +4371,6 @@
%{ /* NOCONTEXT */
char *env;
-#ifndef __BORLANDC__
- extern char *getenv();
-#endif
if (__isString(aStringOrSymbol) || __isSymbol(aStringOrSymbol)) {
char buff[512];
@@ -5832,7 +5829,19 @@
"return the name of the users home directory
(i.e. yours)"
- ^ OperatingSystem getEnvironment:'HOME'
+ |dir drv path|
+
+ dir := self getEnvironment:'HOME'.
+ dir isNil ifTrue:[
+ "/ for NT users:
+ "/ if HOME is nil, try HOMEDRIVE and HOMEPATH
+ "/
+ ((drv := self getEnvironment:'HOMEDRIVE') notNil
+ and:[(path := self getEnvironment:'HOMEPATH') notNil]) ifTrue:[
+ dir := drv , path
+ ]
+ ].
+ ^ dir
"
OperatingSystem getHomeDirectory
@@ -5851,7 +5860,6 @@
static firstCall = 1;
#ifndef __BORLANDC__
extern char *getenv();
- extern char *getlogin();
#endif
char *name = (char *)0;
@@ -6680,6 +6688,6 @@
!Win32OperatingSystem class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/Win32OperatingSystem.st,v 1.39 1999-03-13 12:20:37 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/Win32OperatingSystem.st,v 1.40 1999-03-25 16:02:17 cg Exp $'
! !
Win32OperatingSystem initialize!