/var/lib/pcp/testsuite/src/matchInstanceName.c is in pcp-testsuite 4.0.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | /*
* for PV 939998 affecting pmgadgets instance cache
*/
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
static int
matchInstanceName(char *p, char *q)
{
for (;; p++, q++) {
if ((*p == ' ' || *p == '\0') &&
(*q == ' ' || *q == '\0'))
return 1;
if (*p != *q || *p == ' ' || *p == '\0' ||
*q == ' ' || *q == '\0')
return 0;
}
}
int
main(int argc, char *argv[])
{
char *a = argv[1];
char *b = argv[2];
if (argc != 3) {
fprintf(stderr, "Usage: %s string1 string2\n", argv[0]);
exit(1);
}
printf("\"%s\" \"%s\" %s\n", a, b,
matchInstanceName(a, b) ? "true" : "false");
exit(0);
}
|