Allow fill_archive to be called with NULL fname.

The fill_archive function should support being
called with a NULL fname argument. A NULL fname
argument indicates that the default archive should
be opened. We enable this by setting ah.fname to
NULL before initializing ah or calling open_archive.
This way if fname is NULL then ah.fname remains NULL
and open_archive opens the default archive.
This commit is contained in:
Carlos O'Donell 2013-10-18 23:27:45 -04:00
parent f03231b069
commit f6520166f4
1 changed files with 1 additions and 0 deletions

View File

@ -311,6 +311,7 @@ fill_archive (struct locarhandle *tmpl_ah,
/* Open the archive. This call never returns if we cannot
successfully open the archive. */
ah.fname = NULL;
if (fname != NULL)
ah.fname = fname;
open_archive (&ah, false);