Browse Source

print_news()

rlar 15 years ago
parent
commit
1b0e1730d3
  1. 4
      ChangeLog
  2. 29
      src/main.c

4
ChangeLog

@ -1,3 +1,7 @@
2011-07-02 Robert Larice
* src/main.c :
print_news()
2011-07-01 Robert Larice 2011-07-01 Robert Larice
* src/main.c , * src/main.c ,
* src/nghelp.c , * src/nghelp.c ,

29
src/main.c

@ -753,6 +753,22 @@ read_initialisation_file(char * dir, char * name)
/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */
static void
print_news(void)
{
if (News_File && *News_File) {
char* fname = cp_tildexpand(News_File); /*DG Memory leak */
FILE *fp = fopen(fname, "r");
tfree(fname);
if (fp) {
char buf[BSIZE_SP];
while (fgets(buf, BSIZE_SP, fp))
fputs(buf, stdout);
(void) fclose(fp);
}
}
}
int int
#ifdef HAS_WINDOWS #ifdef HAS_WINDOWS
@ -763,7 +779,6 @@ main(int argc, char **argv)
{ {
int c, err; int c, err;
bool gotone = FALSE; bool gotone = FALSE;
char* copystring;
bool addctrlsect = TRUE; /* PN: for autorun */ bool addctrlsect = TRUE; /* PN: for autorun */
@ -781,7 +796,6 @@ main(int argc, char **argv)
bool iflag = FALSE; bool iflag = FALSE;
bool qflag = FALSE; bool qflag = FALSE;
FILE *fp;
FILE *circuit_file; FILE *circuit_file;
bool orflag = FALSE; bool orflag = FALSE;
@ -1080,16 +1094,7 @@ main(int argc, char **argv)
if (!ft_batchmode) { if (!ft_batchmode) {
com_version(NULL); com_version(NULL);
DevInit( ); DevInit( );
if (News_File && *News_File) {
copystring=cp_tildexpand(News_File);/*DG Memory leak */
fp = fopen(copystring, "r");
tfree(copystring);
if (fp) {
while (fgets(buf, BSIZE_SP, fp))
fputs(buf, stdout);
(void) fclose(fp);
}
}
print_news();
} }

Loading…
Cancel
Save