Skip to content

Commit 91b53ff

Browse files
committed
Mac fixes
1 parent dd5db46 commit 91b53ff

File tree

4 files changed

+14
-13
lines changed

4 files changed

+14
-13
lines changed

specs/VBA-Web - Specs.xlsm

43.1 KB
Binary file not shown.

src/WebClient.cls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Public Function Execute(Request As WebRequest) As WebResponse
5454

5555
#If Mac Then
5656
Dim web_Curl As String
57-
Dim web_Result As WebShellResult
57+
Dim web_Result As web_ShellResult
5858

5959
web_Curl = Me.PrepareCURLRequest(Request)
6060
web_Result = WebHelpers.ExecuteInShell(web_Curl)

src/WebHelpers.bas

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -933,30 +933,30 @@ End Sub
933933
' @param {String} Command
934934
' @return {WebShellResult}
935935
' --------------------------------------------- '
936-
Public Function ExecuteInShell(Command As String) As WebShellResult
936+
Public Function ExecuteInShell(Command As String) As web_ShellResult
937937
Dim web_File As Long
938938
Dim web_Chunk As String
939939
Dim web_Read As Long
940940

941941
On Error GoTo ErrorHandling
942-
web_File = popen(Command, "r")
942+
web_File = web_popen(Command, "r")
943943

944944
If web_File = 0 Then
945945
' TODO
946946
Exit Function
947947
End If
948948

949-
Do While feof(web_File) = 0
949+
Do While web_feof(web_File) = 0
950950
web_Chunk = VBA.Space$(50)
951-
web_Read = fread(web_Chunk, 1, Len(web_Chunk) - 1, web_File)
951+
web_Read = web_fread(web_Chunk, 1, Len(web_Chunk) - 1, web_File)
952952
If web_Read > 0 Then
953953
web_Chunk = VBA.Left$(web_Chunk, web_Read)
954954
ExecuteInShell.web_Output = ExecuteInShell.web_Output & web_Chunk
955955
End If
956956
Loop
957957

958958
ErrorHandling:
959-
ExecuteInShell.web_ExitCode = pclose(web_File)
959+
ExecuteInShell.web_ExitCode = web_pclose(web_File)
960960
End Function
961961

962962
''

src/WebResponse.cls

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,23 +84,24 @@ End Sub
8484
' @param {String} Result
8585
' --------------------------------------------- '
8686
Public Sub CreateFromCURL(Client As WebClient, Request As WebRequest, Result As String)
87-
Dim web_StatusCode As Long
88-
Dim web_StatusText As String
89-
Dim web_Headers As String
90-
Dim web_Body As Variant
91-
Dim web_ResponseText As String
92-
9387
Dim web_Lines() As String
9488
web_Lines = Split(Result, vbCrLf)
9589

9690
' Extract status code and text from status line
9791
Dim web_StatusLine As String
9892
Dim web_StatusLineParts() As String
93+
Dim web_i As Long
9994
web_StatusLine = web_Lines(0)
10095
web_StatusLineParts = Split(web_StatusLine)
10196

10297
Me.StatusCode = CLng(web_StatusLineParts(1))
103-
Me.StatusDescription = Mid$(web_StatusLine, InStr(1, web_StatusLine, web_StatusCode) + 4)
98+
For web_i = 2 To UBound(web_StatusLineParts)
99+
If web_i > 2 Then
100+
Me.StatusDescription = Me.StatusDescription & " "
101+
End If
102+
103+
Me.StatusDescription = Me.StatusDescription & web_StatusLineParts(web_i)
104+
Next web_i
104105

105106
' Find blank line before body
106107
Dim web_Line As Variant

0 commit comments

Comments
 (0)