commit ccc835f12a86459f480a7ea4b724af67cd0889a7 from: Mark Jamsek date: Fri Feb 10 12:04:49 2023 UTC garbage-collect redundant read_logmsg() parameter As identified and suggested by stsp, with the previous commit, 'strip_comments' is now always set thus no longer needed. ok stsp@ commit - 93436ccdaf0945f5fdb4b5cd2b90c9ac0bb14c83 commit + ccc835f12a86459f480a7ea4b724af67cd0889a7 blob - 4a0cd57f859bca5045a0003d40445f08adc26657 blob + 18b3158fe6c3a78c184a6b640a87f2f1de46d414 --- got/got.c +++ got/got.c @@ -389,8 +389,7 @@ doneediting: } static const struct got_error * -read_logmsg(char **logmsg, size_t *len, FILE *fp, size_t filesize, - int strip_comments) +read_logmsg(char **logmsg, size_t *len, FILE *fp, size_t filesize) { const struct got_error *err = NULL; char *line = NULL; @@ -408,8 +407,7 @@ read_logmsg(char **logmsg, size_t *len, FILE *fp, size (*logmsg)[0] = '\0'; while (getline(&line, &linesize, fp) != -1) { - if ((strip_comments && line[0] == '#') || - (*len == 0 && line[0] == '\n')) + if (line[0] == '#' || (*len == 0 && line[0] == '\n')) continue; /* remove comments and leading empty lines */ *len = strlcat(*logmsg, line, filesize + 1); if (*len >= filesize + 1) { @@ -468,7 +466,7 @@ edit_logmsg(char **logmsg, const char *editor, const c } /* strip comments and leading/trailing newlines */ - err = read_logmsg(logmsg, &logmsg_len, fp, st2.st_size, 1); + err = read_logmsg(logmsg, &logmsg_len, fp, st2.st_size); if (err) goto done; if (logmsg_len == 0) {