# HG changeset patch # User rubidium # Date 2010-03-15 17:44:54 # Node ID 6c3ace5f137c42a64a019504aaa7f2f0a47d9472 # Parent a1801b3f007f75d2d2996cf0265ead1a63ed39ae (svn r19427) -Codechange: gracefully handle the case where we can't open a .tar file. diff --git a/src/fileio.cpp b/src/fileio.cpp --- a/src/fileio.cpp +++ b/src/fileio.cpp @@ -563,7 +563,11 @@ bool TarListAddFile(const char *filename if (it != _tar_list.end()) return false; FILE *f = fopen(filename, "rb"); - assert(f != NULL); + /* Although the file has been found there can be + * a number of reasons we cannot open the file. + * Most common case is when we simply have not + * been given read access. */ + if (f == NULL) return false; const char *dupped_filename = strdup(filename); _tar_list[filename].filename = dupped_filename;