Skip to content

Commit 7215fb1

Browse files
committed
Update ECPTextStream.cls
1 parent 709a020 commit 7215fb1

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/ECPTextStream.cls

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ Attribute streamLength.VB_Description = "Gets the current opened file
120120
streamLength = P_STREAMLENGTH
121121
End Property
122122
Public Property Get unifiedLFOutput() As Boolean
123-
Attribute unifiedLFOutput.VB_Description = "Determines whether the buffer string is returned using only the LF character as a linefeed."
124123
unifiedLFOutput = P_UNIFIEDLFOUTPUT
125124
End Property
126125
Public Property Let unifiedLFOutput(value As Boolean)
@@ -150,10 +149,11 @@ Private Sub FindEOLcharacter()
150149

151150
Do
152151
bufferReverse = StrReverse(Buffer)
153-
LastCrLfPos = InStrB(1, bufferReverse, InverseCRLF) + 2
152+
LastCrLfPos = InStrB(1, bufferReverse, InverseCRLF)
153+
If LastCrLfPos Then LastCrLfPos = LastCrLfPos + 2
154154
LastCrPos = InStrB(1, bufferReverse, vbCr)
155155
LastLfPos = InStrB(1, bufferReverse, vbLf)
156-
missingEOLchar = (LastCrLfPos - 2 = 0 And LastCrPos = 0 And LastLfPos = 0)
156+
missingEOLchar = (LastCrLfPos = 0 And LastCrPos = 0 And LastLfPos = 0)
157157
If missingEOLchar Then
158158
tmpBuffer = Buffer
159159
Get #FileHandled, , Buffer
@@ -201,10 +201,10 @@ Private Sub FindEOLcharacter()
201201
Seek #FileHandled, CorrectedPos
202202
End Sub
203203
Private Sub NormalizeLineBreaks()
204-
If InStrB(1, P_TEXT, vbCr, vbBinaryCompare) > 0 Then
204+
If InStrB(1, P_TEXT, vbCr, vbBinaryCompare) Then
205205
P_TEXT = Replace(P_TEXT, vbCr, vbLf, 1)
206206
End If
207-
Do While InStrB(1, P_TEXT, DualLFchar, vbBinaryCompare) > 0
207+
Do While InStrB(1, P_TEXT, DualLFchar, vbBinaryCompare)
208208
P_TEXT = Replace(P_TEXT, DualLFchar, vbLf, 1)
209209
Loop
210210
P_LINEBREAK = vbLf
@@ -257,9 +257,9 @@ Attribute RestartPointer.VB_Description = "Moves the pointer to the text stream
257257
End Sub
258258
Public Sub SeekPointer(Position As Long)
259259
Attribute SeekPointer.VB_Description = "Moves the pointer, over the target file, to the specified position."
260-
If Position > 0 Then
260+
If Position Then
261261
If P_ISOPENSTREAM Then
262-
If P_STREAMLENGTH > 0 Then
262+
If P_STREAMLENGTH Then
263263
Seek #FileHandled, Position
264264
CorrectedPos = Seek(FileHandled)
265265
LCS = P_STREAMLENGTH - CorrectedPos
@@ -316,4 +316,4 @@ Private Sub Class_Terminate()
316316
If P_ISOPENSTREAM Then
317317
CloseStream
318318
End If
319-
End Sub
319+
End Sub

0 commit comments

Comments
 (0)