"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/config.c" between
tin-2.4.4.tar.xz and tin-2.4.5.tar.xz

About: TIN is a threaded NNTP and spool based UseNet newsreader.

config.c  (tin-2.4.4.tar.xz):config.c  (tin-2.4.5.tar.xz)
/* /*
* Project : tin - a Usenet reader * Project : tin - a Usenet reader
* Module : config.c * Module : config.c
* Author : I. Lea * Author : I. Lea
* Created : 1991-04-01 * Created : 1991-04-01
* Updated : 2019-07-03 * Updated : 2020-04-23
* Notes : Configuration file routines * Notes : Configuration file routines
* *
* Copyright (c) 1991-2020 Iain Lea <iain@bricbrac.de> * Copyright (c) 1991-2021 Iain Lea <iain@bricbrac.de>
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:
* *
* 1. Redistributions of source code must retain the above copyright notice, * 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer. * this list of conditions and the following disclaimer.
* *
* 2. Redistributions in binary form must reproduce the above copyright * 2. Redistributions in binary form must reproduce the above copyright
skipping to change at line 1485 skipping to change at line 1485
* after the first start of a tin 1.5.19 (or later) version. * after the first start of a tin 1.5.19 (or later) version.
*/ */
for (i = 0; i < num_newnews; i++) { for (i = 0; i < num_newnews; i++) {
if (i == j) if (i == j)
continue; continue;
if (my_strftime(timestring, sizeof(timestring) - 1, "%Y-% m-%d %H:%M:%S UTC", gmtime(&(newnews[i].time)))) if (my_strftime(timestring, sizeof(timestring) - 1, "%Y-% m-%d %H:%M:%S UTC", gmtime(&(newnews[i].time))))
fprintf(fp, "newnews=%s %lu (%s)\n", newnews[i].h ost, (unsigned long int) newnews[i].time, timestring); fprintf(fp, "newnews=%s %lu (%s)\n", newnews[i].h ost, (unsigned long int) newnews[i].time, timestring);
} }
} }
#ifdef HAVE_FCHMOD
fchmod(fileno(fp), (mode_t) (S_IRUSR|S_IWUSR)); /* rename_file() preserve s mode */ fchmod(fileno(fp), (mode_t) (S_IRUSR|S_IWUSR)); /* rename_file() preserve s mode */
#else
# ifdef HAVE_CHMOD
chmod(file_tmp, (mode_t) (S_IRUSR|S_IWUSR)); /* rename_file() preserves m
ode */
# endif /* HAVE_CHMOD */
#endif /* HAVE_FCHMOD */
if ((i = ferror(fp)) || fclose(fp)) { if ((i = ferror(fp)) || fclose(fp)) {
error_message(2, _(txt_filesystem_full), CONFIG_FILE); error_message(2, _(txt_filesystem_full), CONFIG_FILE);
if (i) { if (i) {
clearerr(fp); clearerr(fp);
fclose(fp); fclose(fp);
} }
} else } else
rename_file(file_tmp, file); rename_file(file_tmp, file);
skipping to change at line 2059 skipping to change at line 2065
break; break;
case 's': case 's':
/* /*
* previous versions has always passed groupname to external * previous versions has always passed groupname to external
* commands, now we look for %G * commands, now we look for %G
*/ */
if (match_string(buf, "sigfile=", tinrc.sigfile, sizeof(tinrc.sigfile))) { if (match_string(buf, "sigfile=", tinrc.sigfile, sizeof(tinrc.sigfile))) {
size_t l = strlen(tinrc.sigfile); size_t l = strlen(tinrc.sigfile);
if (tinrc.sigfile[0] == '!'&& (tinrc.sigf ile[l - 2] != '%' || tinrc.sigfile[l - 1] != 'G')) { if (tinrc.sigfile[0] == '!' && (tinrc.sig file[l - 2] != '%' || tinrc.sigfile[l - 1] != 'G')) {
char *newbuf = my_malloc(sizeof(t inrc.sigfile) + 4); char *newbuf = my_malloc(sizeof(t inrc.sigfile) + 4);
sprintf(newbuf, "%s %s", tinrc.si gfile, "%G"); sprintf(newbuf, "%s %s", tinrc.si gfile, "%G");
my_strncpy(tinrc.sigfile, newbuf, sizeof(tinrc.sigfile) - 1); my_strncpy(tinrc.sigfile, newbuf, sizeof(tinrc.sigfile) - 1);
free(newbuf); free(newbuf);
} }
break; break;
} }
break; break;
skipping to change at line 2209 skipping to change at line 2215
} }
fprintf(fp, _(txt_serverconfig_header), PRODUCT, tin_progname, VERSION, R ELEASEDATE, RELEASENAME, PRODUCT, PRODUCT); fprintf(fp, _(txt_serverconfig_header), PRODUCT, tin_progname, VERSION, R ELEASEDATE, RELEASENAME, PRODUCT, PRODUCT);
fprintf(fp, "version=%s\n", SERVERCONFIG_VERSION); fprintf(fp, "version=%s\n", SERVERCONFIG_VERSION);
if ((i = find_newnews_index(nntp_server)) >= 0) { if ((i = find_newnews_index(nntp_server)) >= 0) {
if (my_strftime(timestring, sizeof(timestring) - 1, "%Y-%m-%d %H: %M:%S UTC", gmtime(&(newnews[i].time)))) if (my_strftime(timestring, sizeof(timestring) - 1, "%Y-%m-%d %H: %M:%S UTC", gmtime(&(newnews[i].time))))
fprintf(fp, "last_newnews=%lu (%s)\n", (unsigned long int ) newnews[i].time, timestring); fprintf(fp, "last_newnews=%lu (%s)\n", (unsigned long int ) newnews[i].time, timestring);
} }
#ifdef HAVE_FCHMOD
fchmod(fileno(fp), (mode_t) (S_IRUSR|S_IWUSR)); /* rename_file() preserve s mode */ fchmod(fileno(fp), (mode_t) (S_IRUSR|S_IWUSR)); /* rename_file() preserve s mode */
#else
# ifdef HAVE_CHMOD
chmod(file_tmp, (mode_t) (S_IRUSR|S_IWUSR)); /* rename_file() preserves m
ode */
# endif /* HAVE_CHMOD */
#endif /* HAVE_FCHMOD */
if ((i = ferror(fp)) || fclose(fp)) { if ((i = ferror(fp)) || fclose(fp)) {
error_message(2, _(txt_filesystem_full), SERVERCONFIG_FILE); error_message(2, _(txt_filesystem_full), SERVERCONFIG_FILE);
if (i) { if (i) {
clearerr(fp); clearerr(fp);
fclose(fp); fclose(fp);
} }
} else } else
rename_file(file_tmp, file); rename_file(file_tmp, file);
 End of changes. 7 change blocks. 
3 lines changed or deleted 17 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)