Commit ac593860 authored by Wayne Davison's avatar Wayne Davison

Used a couple "#if SUBPROTOCOL_VERSION != 0" conditionals.

parent 73a649b7
...@@ -67,13 +67,19 @@ static void check_sub_protocol(void) ...@@ -67,13 +67,19 @@ static void check_sub_protocol(void)
{ {
char *dot; char *dot;
int their_protocol, their_sub; int their_protocol, their_sub;
#if SUBPROTOCOL_VERSION != 0
int our_sub = protocol_version < PROTOCOL_VERSION ? 0 : SUBPROTOCOL_VERSION; int our_sub = protocol_version < PROTOCOL_VERSION ? 0 : SUBPROTOCOL_VERSION;
#else
int our_sub = 0;
#endif
if (!shell_cmd || !(dot = strchr(shell_cmd, '.')) if (!shell_cmd || !(dot = strchr(shell_cmd, '.'))
|| !(their_protocol = atoi(shell_cmd)) || !(their_protocol = atoi(shell_cmd))
|| !(their_sub = atoi(dot+1))) { || !(their_sub = atoi(dot+1))) {
#if SUBPROTOCOL_VERSION != 0
if (our_sub) if (our_sub)
protocol_version--; protocol_version--;
#endif
return; return;
} }
...@@ -84,7 +90,7 @@ static void check_sub_protocol(void) ...@@ -84,7 +90,7 @@ static void check_sub_protocol(void)
} }
if (their_protocol > protocol_version) if (their_protocol > protocol_version)
their_sub = 0; /* 0 == final version */ their_sub = 0; /* 0 == final version of older protocol */
if (their_sub != our_sub) if (their_sub != our_sub)
protocol_version--; protocol_version--;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment