aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2024-12-30 14:27:36 -0500
committerJoseph Hunkeler <jhunkeler@gmail.com>2024-12-30 14:27:36 -0500
commit6d0abd904b642ffd531e7543170ab9c309b65f91 (patch)
tree1d3eb2e68f6b05556adfe349f2ae794a1eb30969
parent13f7a7611bb9b7a3e9927ed0438793bb951aad01 (diff)
downloadstasis-fix-index-junitxml-report.tar.gz
Truncate the basename of the xml file only when an extension is presentfix-index-junitxml-report
-rw-r--r--src/cli/stasis_indexer/junitxml_report.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/cli/stasis_indexer/junitxml_report.c b/src/cli/stasis_indexer/junitxml_report.c
index 65ec4f5..d7d8f9a 100644
--- a/src/cli/stasis_indexer/junitxml_report.c
+++ b/src/cli/stasis_indexer/junitxml_report.c
@@ -29,7 +29,9 @@ static int write_report_output(struct Delivery *ctx, FILE *destfp, const char *x
char *bname_tmp = strdup(xmlfilename);
char *bname = path_basename(bname_tmp);
- bname[strlen(bname) - 4] = 0;
+ if (endswith(bname, ".xml")) {
+ bname[strlen(bname) - 4] = 0;
+ }
guard_free(bname_tmp);
char result_outfile[PATH_MAX] = {0};