Blank line in history
This commit is contained in:
parent
4c1763f6c4
commit
2774726c65
|
@ -86,7 +86,7 @@ void connectedCommunication(int sockfd)
|
|||
char sendBuff[SEND_BUFFER_SIZE] = {0};
|
||||
char receiveBuff[RECEIVE_BUFFER_SIZE] = {0};
|
||||
|
||||
char historyBuff[SEND_BUFFER_SIZE * NHISTORY] = {0};
|
||||
char historyBuff[SEND_BUFFER_SIZE * NHISTORY + 1] = {0};
|
||||
int historyIndex = 0, historyModifier;
|
||||
|
||||
char curChar;
|
||||
|
@ -136,7 +136,7 @@ void connectedCommunication(int sockfd)
|
|||
if (historyIndex <= 0)
|
||||
break;
|
||||
historyModifier = (historyModifier + 1)
|
||||
% (historyIndex);
|
||||
% (historyIndex + 1);
|
||||
printf("\33[2K\r%s%s",
|
||||
promptString,
|
||||
&historyBuff[
|
||||
|
@ -155,8 +155,8 @@ void connectedCommunication(int sockfd)
|
|||
|
||||
if (historyIndex <= 0)
|
||||
break;
|
||||
historyModifier = (historyModifier + historyIndex - 1)
|
||||
% (historyIndex);
|
||||
historyModifier = (historyModifier + historyIndex)
|
||||
% (historyIndex + 1);
|
||||
printf("\33[2K\r%s%s",
|
||||
promptString,
|
||||
&historyBuff[
|
||||
|
|
Loading…
Reference in New Issue