]> wimlib.net Git - wimlib/blobdiff - src/lookup_table.c
Clean up file headers
[wimlib] / src / lookup_table.c
index 3bb77a4b221ed57fe0c746fc8a8be99c5b746bf5..828c183048a7d55aec46f5a9844a37cbac3784eb 100644 (file)
@@ -3,23 +3,25 @@
  *
  * Lookup table, implemented as a hash table, that maps dentries to file
  * resources.
- *
+ */
+
+/*
  * Copyright (C) 2012 Eric Biggers
  *
- * wimlib - Library for working with WIM files 
+ * This file is part of wimlib, a library for working with WIM files.
  *
- * This library is free software; you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License as published by the Free
- * Software Foundation; either version 2.1 of the License, or (at your option) any
- * later version.
+ * wimlib is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
  *
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * wimlib is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
  *
- * You should have received a copy of the GNU Lesser General Public License along
- * with this library; if not, write to the Free Software Foundation, Inc., 59
- * Temple Place, Suite 330, Boston, MA 02111-1307 USA 
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with wimlib; if not, see http://www.gnu.org/licenses/.
  */
 
 #include "wimlib_internal.h"
@@ -264,14 +266,17 @@ int write_lookup_table_entry(struct lookup_table_entry *lte, void *__out)
 
        out = __out;
 
+       /* do not write lookup table entries for empty files */
+       if (lte->output_resource_entry.original_size == 0)
+               return 0;
+
        /* Don't write entries that have not had file resources or metadata
         * resources written for them. */
        if (lte->out_refcnt == 0)
                return 0;
 
-       if (lte->output_resource_entry.flags & WIM_RESHDR_FLAG_METADATA) {
+       if (lte->output_resource_entry.flags & WIM_RESHDR_FLAG_METADATA)
                DEBUG("Writing metadata entry at %lu\n", ftello(out));
-       }
 
        p = put_resource_entry(buf, &lte->output_resource_entry);
        p = put_u16(p, lte->part_number);