Trim resume file names as required.
authorEric S. Raymond <esr@thyrsus.com>
Tue, 21 Mar 2023 16:30:39 +0000 (12:30 -0400)
committerEric S. Raymond <esr@thyrsus.com>
Thu, 23 Mar 2023 15:28:53 +0000 (11:28 -0400)
misc.c

diff --git a/misc.c b/misc.c
index 9e18c7481586960bc3c21f898b96d091a952362e..0725ab5bd86efdc1a8dc1180dd38ac9f5d7bc4f3 100644 (file)
--- 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;