Skip to content

Commit 362f08d

Browse files
committed
complain if receipt file is the same as one of the input files
1 parent 47057d7 commit 362f08d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/bin/unit_test_attribute.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4596,6 +4596,13 @@ int main(int argc, char *argv[])
45964596
} else if (argc > 1) {
45974597
int i;
45984598

4599+
for (i = 1; i < argc; i++) {
4600+
if (strcmp(receipt_file, argv[i]) == 0) {
4601+
ERROR("Receipt file cannot be one of the input files");
4602+
EXIT_WITH_FAILURE;
4603+
}
4604+
}
4605+
45994606
/*
46004607
* Read test commands from a list of files in argv[].
46014608
*/

0 commit comments

Comments
 (0)