Skip to content

Commit

Permalink
Used a couple "#if SUBPROTOCOL_VERSION != 0" conditionals.
Browse files Browse the repository at this point in the history
  • Loading branch information
Wayne Davison committed Sep 9, 2007
1 parent 73a649b commit ac59386
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,19 @@ static void check_sub_protocol(void)
{
char *dot;
int their_protocol, their_sub;
#if SUBPROTOCOL_VERSION != 0
int our_sub = protocol_version < PROTOCOL_VERSION ? 0 : SUBPROTOCOL_VERSION;
#else
int our_sub = 0;
#endif

if (!shell_cmd || !(dot = strchr(shell_cmd, '.'))
|| !(their_protocol = atoi(shell_cmd))
|| !(their_sub = atoi(dot+1))) {
#if SUBPROTOCOL_VERSION != 0
if (our_sub)
protocol_version--;
#endif
return;
}

Expand All @@ -84,7 +90,7 @@ static void check_sub_protocol(void)
}

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)
protocol_version--;
}
Expand Down

0 comments on commit ac59386

Please sign in to comment.