--- a/Win32OperatingSystem.st Mon Jul 26 18:47:19 1999 +0200
+++ b/Win32OperatingSystem.st Mon Jul 26 19:47:24 1999 +0200
@@ -2516,31 +2516,31 @@
|path f fExt|
aCommand asFilename isAbsolute ifTrue:[
- aCommand asFilename exists ifTrue:[
- ^ aCommand
- ].
- ^ nil
+ aCommand asFilename exists ifTrue:[
+ ^ aCommand
+ ].
+ ^ nil
].
path := self getEnvironment:'PATH'.
path notNil ifTrue:[
- (path asCollectionOfSubstringsSeparatedBy:(self pathSeparator)) do:[:path |
- path isEmpty ifTrue:[
- f := aCommand asFilename
- ] ifFalse:[
- f := path asFilename construct:aCommand.
- ].
- self executableFileExtensions do:[:ext |
- ext notEmpty ifTrue:[
- fExt := (f pathName , '.' , ext) asFilename.
- ] ifFalse:[
- fExt := f.
- ].
- fExt isExecutable ifTrue:[
- ^ fExt pathName
- ].
- ].
- ].
+ (path asCollectionOfSubstringsSeparatedBy:(self pathSeparator)) do:[:path |
+ path isEmpty ifTrue:[
+ f := aCommand asFilename
+ ] ifFalse:[
+ f := path asFilename construct:aCommand.
+ ].
+ self executableFileExtensions do:[:ext |
+ ext notEmpty ifTrue:[
+ fExt := (f pathName , '.' , ext) asFilename.
+ ] ifFalse:[
+ fExt := f.
+ ].
+ fExt isExecutable ifTrue:[
+ ^ fExt pathName
+ ].
+ ].
+ ].
].
^ nil
@@ -2769,7 +2769,9 @@
] ifFalse:[
self isMSWINDOWSNTlike ifTrue:[
inStream := 'nul' asFilename readStream.
- in := inStream fileDescriptor.
+ inStream notNil ifTrue:[
+ in := inStream fileDescriptor.
+ ]
]
].
anExternalOutStream notNil ifTrue:[
@@ -2777,7 +2779,9 @@
] ifFalse:[
self isMSWINDOWSNTlike ifTrue:[
outStream := 'nul' asFilename writeStream.
- out := outStream fileDescriptor.
+ outStream notNil ifTrue:[
+ out := outStream fileDescriptor.
+ ]
]
].
anExternalErrStream notNil ifTrue:[
@@ -2785,7 +2789,9 @@
] ifFalse:[
self isMSWINDOWSNTlike ifTrue:[
errStream := 'nul' asFilename writeStream.
- err := errStream fileDescriptor.
+ errStream notNil ifTrue:[
+ err := errStream fileDescriptor.
+ ]
]
].
@@ -4457,66 +4463,66 @@
getDomainName
"return the domain this host is in.
Notice:
- not all systems support this; on some, 'unknown' is returned."
+ not all systems support this; on some, 'unknown' is returned."
|name idx hostName k|
DomainName notNil ifTrue:[
- ^ DomainName
+ ^ DomainName
].
name := self getEnvironment:'DOMAIN'.
name isNil ifTrue:[
- name := self getEnvironment:'DOMAINNAME'.
+ name := self getEnvironment:'DOMAINNAME'.
].
name isNil ifTrue:[
- "/ sometimes, we can extract the domainName from the hostName ...
- hostName := self getHostName.
- hostName notNil ifTrue:[
- idx := hostName indexOf:$..
- idx ~~ 0 ifTrue:[
- name := hostName copyFrom:idx+1.
- ]
- ].
- name isNil ifTrue:[
- "/ ok, search the registry ...
-
- "/ under NT, it is found there ...
- k := RegistryEntry key:'HKEY_LOCAL_MACHINE\System'.
- k notNil ifTrue:[
- k subKeysDo:[:subKey |
- subKey subKeysDo:[:subSubKey |
- |tcp params|
-
- (subSubKey path asLowercase endsWith:'services') ifTrue:[
- tcp := subSubKey subKeyNamed:'tcpip'.
- tcp notNil ifTrue:[
- params := tcp subKeyNamed:'parameters'.
- params notNil ifTrue:[
- name := params valueNamed:'Domain'.
- params close.
- ].
- tcp close.
- ]
- ]
- ]
- ]
- ].
- ].
- name isNil ifTrue:[
- "/ under Win95/Win98, it is found there ...
- k := RegistryEntry key:'HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\VxD\MSTCP'.
- k notNil ifTrue:[
- name := k valueNamed:'Domain'.
- k close.
- ]
- ].
-
- name isNil ifTrue:[
- 'Win32OperatingSystem [warning]: cannot find out domainname' errorPrintCR.
- name := 'unknown'.
- ]
+ "/ sometimes, we can extract the domainName from the hostName ...
+ hostName := self getHostName.
+ hostName notNil ifTrue:[
+ idx := hostName indexOf:$..
+ idx ~~ 0 ifTrue:[
+ name := hostName copyFrom:idx+1.
+ ]
+ ].
+ name isNil ifTrue:[
+ "/ ok, search the registry ...
+
+ "/ under NT, it is found there ...
+ k := RegistryEntry key:'HKEY_LOCAL_MACHINE\System'.
+ k notNil ifTrue:[
+ k subKeysDo:[:subKey |
+ subKey subKeysDo:[:subSubKey |
+ |tcp params|
+
+ (subSubKey path asLowercase endsWith:'services') ifTrue:[
+ tcp := subSubKey subKeyNamed:'tcpip'.
+ tcp notNil ifTrue:[
+ params := tcp subKeyNamed:'parameters'.
+ params notNil ifTrue:[
+ name := params valueNamed:'Domain'.
+ params close.
+ ].
+ tcp close.
+ ]
+ ]
+ ]
+ ]
+ ].
+ ].
+ name isNil ifTrue:[
+ "/ under Win95/Win98, it is found there ...
+ k := RegistryEntry key:'HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\VxD\MSTCP'.
+ k notNil ifTrue:[
+ name := k valueNamed:'Domain'.
+ k close.
+ ]
+ ].
+
+ name isNil ifTrue:[
+ 'Win32OperatingSystem [warning]: cannot find out domainname' errorPrintCR.
+ name := 'unknown'.
+ ]
].
DomainName := name.
^ name
@@ -5424,7 +5430,7 @@
k := RegistryEntry key:'HKEY_LOCAL_MACHINE\SOFTWARE\eXept\Smalltalk/X\' , Smalltalk versionString.
k notNil ifTrue:[
- p := k valueNamed:'BinDir'
+ p := k valueNamed:'BinDir'
].
^ p
@@ -5440,7 +5446,7 @@
k := RegistryEntry key:'HKEY_LOCAL_MACHINE\SOFTWARE\eXept\Smalltalk/X\' , Smalltalk versionString.
k notNil ifTrue:[
- p := k valueNamed:'LibDir'
+ p := k valueNamed:'LibDir'
].
^ p
@@ -7796,6 +7802,6 @@
!Win32OperatingSystem class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/Win32OperatingSystem.st,v 1.74 1999-07-09 15:03:21 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/Win32OperatingSystem.st,v 1.75 1999-07-26 17:47:24 cg Exp $'
! !
Win32OperatingSystem initialize!