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 sendBuff[SEND_BUFFER_SIZE] = {0};
|
||||||
char receiveBuff[RECEIVE_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;
|
int historyIndex = 0, historyModifier;
|
||||||
|
|
||||||
char curChar;
|
char curChar;
|
||||||
|
@ -136,7 +136,7 @@ void connectedCommunication(int sockfd)
|
||||||
if (historyIndex <= 0)
|
if (historyIndex <= 0)
|
||||||
break;
|
break;
|
||||||
historyModifier = (historyModifier + 1)
|
historyModifier = (historyModifier + 1)
|
||||||
% (historyIndex);
|
% (historyIndex + 1);
|
||||||
printf("\33[2K\r%s%s",
|
printf("\33[2K\r%s%s",
|
||||||
promptString,
|
promptString,
|
||||||
&historyBuff[
|
&historyBuff[
|
||||||
|
@ -155,8 +155,8 @@ void connectedCommunication(int sockfd)
|
||||||
|
|
||||||
if (historyIndex <= 0)
|
if (historyIndex <= 0)
|
||||||
break;
|
break;
|
||||||
historyModifier = (historyModifier + historyIndex - 1)
|
historyModifier = (historyModifier + historyIndex)
|
||||||
% (historyIndex);
|
% (historyIndex + 1);
|
||||||
printf("\33[2K\r%s%s",
|
printf("\33[2K\r%s%s",
|
||||||
promptString,
|
promptString,
|
||||||
&historyBuff[
|
&historyBuff[
|
||||||
|
|
Loading…
Reference in New Issue