Pass the "appbroker.sh" test again

This commit is contained in:
Pierre Pronchery 2016-09-13 04:32:49 +02:00
parent da7a2954d9
commit 582a5d0b1d

View File

@ -96,7 +96,7 @@ static int _appbroker(AppTransportMode mode, char const * outfile,
static void _appbroker_calls(AppBroker * appbroker) static void _appbroker_calls(AppBroker * appbroker)
{ {
if(appbroker->fp != NULL) if(appbroker->fp != NULL)
fputs("\n\n/* calls */\n", appbroker->fp); fputs("\n/* calls */\n", appbroker->fp);
hash_foreach(appbroker->config, hash_foreach(appbroker->config,
(HashForeach)_appbroker_foreach_call, appbroker); (HashForeach)_appbroker_foreach_call, appbroker);
} }
@ -231,13 +231,14 @@ static int _appbroker_foreach_call_arg(AppBroker * appbroker, char const * sep,
{ {
char const * ctype; char const * ctype;
char * p; char * p;
String * q;
if((p = strchr(arg, ',')) == NULL) if((p = strchr(arg, ',')) == NULL)
ctype = _appbroker_ctype(arg); ctype = _appbroker_ctype(arg);
else if((p = string_new_length(arg, p - arg)) != NULL) else if((q = string_new_length(arg, p - arg)) != NULL)
{ {
ctype = _appbroker_ctype(p); ctype = _appbroker_ctype(q);
string_delete(p); string_delete(q);
} }
else else
{ {
@ -245,7 +246,8 @@ static int _appbroker_foreach_call_arg(AppBroker * appbroker, char const * sep,
return -1; return -1;
} }
if(appbroker->fp != NULL) if(appbroker->fp != NULL)
fprintf(appbroker->fp, "%s%s", sep, ctype); fprintf(appbroker->fp, "%s%s%s%s", sep, ctype,
string_length(p + 1) ? " " : "", p + 1);
return 0; return 0;
} }