Skip to content

Commit

Permalink
v1.1 fix for cr/fl probilem
Browse files Browse the repository at this point in the history
  • Loading branch information
tenox7 committed Jan 26, 2016
1 parent f449a2b commit 5923d10
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions cmdsave.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Module Name:
Version:
1.0 - initial release
1.1 - crlf fix
Author:
Expand Down Expand Up @@ -68,7 +68,7 @@ int main(int argc, char **argv) {
if(GetConsoleScreenBufferInfo(hConsole, &cbi)==0)
ERRPT("GetConsoleScreenBufferInfo");

buff=HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (cbi.dwSize.X+2)*sizeof(WCHAR));
buff=HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (cbi.dwSize.X+3)*sizeof(WCHAR));
if(buff==NULL)
ERRPT("HeapAlloc");

Expand All @@ -92,14 +92,15 @@ int main(int argc, char **argv) {
if(n==0)
n=-1;

buff[n+1]='\n';
buff[n+2]='\0';
buff[n+1]='\r';
buff[n+2]='\n';
buff[n+3]='\0';

if(WriteFile(hFile, buff, strlen(buff), &ochr, NULL)==0)
ERRPT("WriteFile");

// for vertical trim
if(buff[0]!='\n')
if(buff[0]!='\r')
l=GetFileSize(hFile, NULL);

start.Y++;
Expand Down

0 comments on commit 5923d10

Please sign in to comment.