Fix resize up problem
[yaffs2.git] / yaffs_guts.c
index ab22c85e54979803998fb711854a274bfef5c3af..df368e3e746618b0c202e7cb11f87e1756c06010 100644 (file)
@@ -9,11 +9,10 @@
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
- *
  */
 
 const char *yaffs_guts_c_version =
-    "$Id: yaffs_guts.c,v 1.46 2007-02-12 16:55:26 wookey Exp $";
+    "$Id: yaffs_guts.c,v 1.48 2007-03-12 20:55:39 charles Exp $";
 
 #include "yportenv.h"
 
@@ -4311,7 +4310,13 @@ int yaffs_ResizeFile(yaffs_Object * in, loff_t newSize)
                in->variant.fileVariant.fileSize = newSize;
 
                yaffs_PruneFileStructure(dev, &in->variant.fileVariant);
+       } else {
+               /* newsSize > oldFileSize */
+               in->variant.fileVariant.fileSize = newSize;
        }
+
+               
+       
        /* Write a new object header.
         * show we've shrunk the file, if need be
         * Do this only if the file is not in the deleted directories.