﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
1831	_FileCountLines does not handles null characters	Fabien OBRIER <fobrier@…>		"When using _FileCountLines on a text file containing some NULL (=Chr(0)) the function does not report the whole number of lines.
The function only return the number of lines before the first NULL character.

To avoid this, I propose to include a StrinReplace to delete the NULL characters as below:

{{{
Func _FileCountLines($sFilePath)

	Local $hFile = FileOpen($sFilePath, $FO_READ)
	If $hFile = -1 Then Return SetError(1, 0, 0)
	Local $sFileContent = StringStripWS(StringReplace(FileRead($hFile), Chr(0), """"), 2) ;****here is the modified line****
	FileClose($hFile)
	msgbox(0, """", $sFileContent)
	Local $aTmp
	If StringInStr($sFileContent, @LF) Then
		$aTmp = StringSplit(StringStripCR($sFileContent), @LF)
	ElseIf StringInStr($sFileContent, @CR) Then
		$aTmp = StringSplit($sFileContent, @CR)
	Else
		If StringLen($sFileContent) Then
			Return 1
		Else
			Return SetError(2, 0, 0)
		EndIf
	EndIf
	Return $aTmp[0]
EndFunc 
}}}

Best regards,
Fabien OBRIER"	Bug	closed		AutoIt	3.3.6.1	None	Fixed	file.au3 _FileCountLines	
