implemented the exit_cmd macro
This commit is contained in:
parent
b2ca56e927
commit
b2c945fe6d
@ -110,7 +110,7 @@ int main(void)
|
|||||||
|
|
||||||
why2_send_socket(line, NULL, listen_socket); //NULL IS SENT BECAUSE IT IS USELESS TO SEND USER FROM CLIENT - SERVER WON'T USE IT
|
why2_send_socket(line, NULL, listen_socket); //NULL IS SENT BECAUSE IT IS USELESS TO SEND USER FROM CLIENT - SERVER WON'T USE IT
|
||||||
|
|
||||||
if (strcmp(line, "!exit\n") == 0) //USER REQUESTED PROGRAM EXIT
|
if (strcmp(line, WHY2_CHAT_COMMAND_PREFIX WHY2_CHAT_COMMAND_EXIT "\n") == 0) //USER REQUESTED PROGRAM EXIT
|
||||||
{
|
{
|
||||||
printf("Exiting...\n");
|
printf("Exiting...\n");
|
||||||
break;
|
break;
|
||||||
|
@ -63,7 +63,7 @@ int main(void)
|
|||||||
{
|
{
|
||||||
if (getline(&line_buffer, &line_length_buffer, stdin) == -1) why2_die("Reading input failed.");
|
if (getline(&line_buffer, &line_length_buffer, stdin) == -1) why2_die("Reading input failed.");
|
||||||
|
|
||||||
if (strcmp(line_buffer, "!exit\n") == 0) //USER REQUESTED PROGRAM EXIT
|
if (strcmp(line_buffer, WHY2_CHAT_COMMAND_PREFIX WHY2_CHAT_COMMAND_EXIT "\n") == 0) //USER REQUESTED PROGRAM EXIT
|
||||||
{
|
{
|
||||||
printf("Exiting...\n");
|
printf("Exiting...\n");
|
||||||
break;
|
break;
|
||||||
|
@ -655,7 +655,7 @@ void *why2_communicate_thread(void *arg)
|
|||||||
{
|
{
|
||||||
if (decoded_buffer[0] == '!') //COMMANDS
|
if (decoded_buffer[0] == '!') //COMMANDS
|
||||||
{
|
{
|
||||||
if (strcmp(decoded_buffer, "!exit") == 0) //USER REQUESTED EXIT
|
if (strcmp(decoded_buffer, WHY2_CHAT_COMMAND_PREFIX WHY2_CHAT_COMMAND_EXIT) == 0) //USER REQUESTED EXIT
|
||||||
{
|
{
|
||||||
exiting = 1;
|
exiting = 1;
|
||||||
} else
|
} else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user