diff options
author | Přemysl Janouch <p@janouch.name> | 2018-11-10 01:32:59 +0100 |
---|---|---|
committer | Přemysl Janouch <p@janouch.name> | 2018-11-10 01:32:59 +0100 |
commit | aae9c392fab706f5470c0d1d7089ec8fbb828eb2 (patch) | |
tree | aeaef81805edb83f2daa0f96b6517ec21b5e5e75 | |
parent | fad0d264a502fdf6f8b1d4a06b02f04f5c902351 (diff) | |
download | sdn-aae9c392fab706f5470c0d1d7089ec8fbb828eb2.tar.gz sdn-aae9c392fab706f5470c0d1d7089ec8fbb828eb2.tar.xz sdn-aae9c392fab706f5470c0d1d7089ec8fbb828eb2.zip |
Also sort symlinks to directories first
-rw-r--r-- | sdn.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -707,8 +707,10 @@ fun update () { } fun operator< (const entry &e1, const entry &e2) -> bool { - auto t1 = make_tuple (e1.filename != "..", !S_ISDIR (e1.info.st_mode)); - auto t2 = make_tuple (e2.filename != "..", !S_ISDIR (e2.info.st_mode)); + auto t1 = make_tuple (e1.filename != "..", + !S_ISDIR (e1.info.st_mode) && !S_ISDIR (e1.target_info.st_mode)); + auto t2 = make_tuple (e2.filename != "..", + !S_ISDIR (e2.info.st_mode) && !S_ISDIR (e2.target_info.st_mode)); if (t1 != t2) return t1 < t2; |