Changeset 208 for Include/Classes/System/Environment.ab
- Timestamp:
- Apr 7, 2007, 10:20:40 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Include/Classes/System/Environment.ab
r173 r208 21 21 Dim size = GetCurrentDirectory(0, 0) 22 22 Dim p = _System_malloc(SizeOf (TCHAR) * size) As PCTSTR 23 GetCurrentDirectory(size, p) 24 CurrentDirectory = p 25 _System_free(p) 23 Dim len = GetCurrentDirectory(size, p) 24 If len < size Then 25 CurrentDirectory = New String(p, size As Long) 26 _System_free(p) 27 End If 26 28 End Function 27 29 … … 72 74 Dim size = GetSystemDirectory(0, 0) 73 75 Dim p = _System_malloc(SizeOf (TCHAR) * size) 74 GetSystemDirectory(size, p)75 sysDir = p76 Dim len = GetSystemDirectory(size, p) 77 sysDir = New String(p, len As Long) 76 78 _System_free(p) 77 79 End IF … … 117 119 Dim dst = _System_malloc(SizeOf (TCHAR) * size) 118 120 ExpandEnvironmentStrings(src, dst, size) 119 ExpandEnvironmentVariables = dst121 ExpandEnvironmentVariables = New String(dst, size - 1) 120 122 _System_free(dst) 121 123 End Function 122 124 123 125 Static Sub FailFast(message As String) 124 OutputDebugString(ToTCStr(message)) 125 ExitProcess(-1) 126 FatalAppExit(0, ToTCStr(message)) 126 127 End Sub 127 128
Note:
See TracChangeset
for help on using the changeset viewer.