In message <1246760322.32517.96.ca...@duiker>
          John-Mark Bell <[email protected]> wrote:

> On Wed, 2009-07-01 at 14:41 +0100, John-Mark Bell wrote:
> 
> [...]
> > Index: desktop/history_global_core.c
> [...]
> > +// 
> > +// /**
> > +//  * Saves the global history's recent URL data.
> > +//  */
> > +// void history_global_save(void)
> > +// {
> > +//         FILE *fp;
> > +//         int i;
> > +// 
> > +//         /* save recent URLs */
> > +//         fp = fopen(option_recent_file, "w");
> > +//         if (!fp)
> > +//                 LOG(("Failed to open file '%s' for writing",
> > +//                      option_recent_file));
> > +//         else {
> > +//                 for (i = global_history_recent_count - 1; i >= 0; i--)
> > +//                         if (strlen(global_history_recent_url[i]) <
> > +//                                                  MAXIMUM_URL_LENGTH)
> > +//                                 fprintf(fp, "%s\n",
> > +//                                         global_history_recent_url[i]);
> > +//                 fclose(fp);
> > +//         }
> > +// }
> > +//
> 
> I assume this will be reinstated?

And if so, 'option_recent_file' global variable is initialised with NULL
(cfr desktop/options.c).  Do we have the garantee that at this point, it
has a useful (non-NULL) value (otherwise fopen() will crash) ? I.e. does
the option reading in desktop/options.c always assign something non-NULL 
to 'option_recent_file' ? If not, this needs to be dealt with somehow.

> [...]
> > Index: desktop/options.c
> > +char *option_recent_file = 0;
> > +char *option_tree_icons_dir = 0;

Slight preference to have the NULL pointer value written as NULL (defined
in stdlib.h) instead of 0.

> >  /** top margin of exported page*/
> >  int option_margin_top = DEFAULT_MARGIN_TOP_MM;
> >  /** bottom margin of exported page*/
> > @@ -243,6 +246,8 @@
> >     { "scale",              OPTION_INTEGER, &option_scale },
> >     { "incremental_reflow", OPTION_BOOL,    &option_incremental_reflow },
> >     { "min_reflow_period",  OPTION_INTEGER, &option_min_reflow_period },
> > +   { "recent_file",        OPTION_STRING,  &option_recent_file },
> > +   { "tree_icons_dir",     OPTION_STRING,  &option_tree_icons_dir },

BTW, just curious, is option_tree_icons_dir used somewhere else ? As I
don't see it in this patch and this option gets only added and initialised
here but apparently nowhere used.

John.
-- 
John Tytgat
[email protected]

Reply via email to