Merge branch 'blr' into develop

Conflicts:
	client/maxadmin.c
	server/core/CMakeLists.txt
	server/core/dcb.c
	server/core/gateway.c
	server/core/poll.c
	server/core/test/CMakeLists.txt
	server/core/test/makefile
	server/include/poll.h
	server/modules/routing/debugcmd.c
This commit is contained in:
Mark Riddoch
2014-11-19 12:00:55 +00:00
84 changed files with 2452 additions and 549 deletions

View File

@ -183,12 +183,22 @@ char c;
len += strlen(argv[i]) + 1;
}
cmd = malloc(len);
int arglen;
memcpy(cmd, argv[optind], (arglen = strlen(argv[optind])) < 8192 ? arglen : 8192);
for (i = optind +1; i < argc; i++) {
cmd = malloc(len + (2 * argc)); // Allow for quotes
strcpy(cmd, argv[optind]);
for (i = optind +1; i < argc; i++)
{
strcat(cmd, " ");
strcat(cmd, argv[i]);
/* Arguments after the seconf are quoted to allow for names
* that contain white space
*/
if (i - optind > 1)
{
strcat(cmd, "\"");
strcat(cmd, argv[i]);
strcat(cmd, "\"");
}
else
strcat(cmd, argv[i]);
}
if (access(cmd, R_OK) == 0)