osutil: fix the bug on OS X when we return more in listdir
authorMaciej Fijalkowski <fijall@gmail.com>
Sat, 20 Aug 2016 23:05:18 +0200
changeset 29821 8656dcac4ce9
parent 29820 e1a4015f5e34
child 29822 61a4cdc98307
osutil: fix the bug on OS X when we return more in listdir The pointer arithmetic somehow got ommitted during the recent change to use a struct.
mercurial/pure/osutil.py
--- a/mercurial/pure/osutil.py	Sun Aug 21 08:03:22 2016 +0000
+++ b/mercurial/pure/osutil.py	Sat Aug 20 23:05:18 2016 +0200
@@ -120,13 +120,14 @@
                 if skip == name and tp == statmod.S_ISDIR:
                     return []
                 if stat:
-                    mtime = cur.time.tv_sec
+                    mtime = cur.mtime.tv_sec
                     mode = (cur.accessmask & ~lib.S_IFMT)| tp
                     ret.append((name, tp, stat_res(st_mode=mode, st_mtime=mtime,
                                 st_size=cur.datalength)))
                 else:
                     ret.append((name, tp))
-                cur += lgt
+                cur = ffi.cast("val_attrs_t*", int(ffi.cast("intptr_t", cur))
+                    + lgt)
         return ret
 
     def listdir(path, stat=False, skip=None):