From 0a63b5e2d6282aae6f6952b5247a319a1030b7c7 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Tue, 21 Mar 2023 12:30:39 -0400 Subject: [PATCH] Trim resume file names as required. --- misc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/misc.c b/misc.c index 9e18c74..0725ab5 100644 --- a/misc.c +++ b/misc.c @@ -994,6 +994,8 @@ L10: fclose(F); L20: printf("\nFile name: "); IGNORE(fgets(NAME, sizeof(NAME), stdin)); + if (NAME[strlen(NAME)-1] == '\n') + NAME[strlen(NAME)-1] = '\0'; F=fopen(NAME,(IN ? READ_MODE : WRITE_MODE)); if(F == NULL) {printf("Can't open file, try again.\n"); goto L20;} return; -- 2.31.1