aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p@janouch.name>2018-12-09 05:28:47 +0100
committerPřemysl Janouch <p@janouch.name>2018-12-09 05:29:59 +0100
commit296c0cc66f5c8fe0617916a6e1faa1286146dae3 (patch)
tree4c7effd8b26711e21a0f172cf3cdcf28e63d0067
parent71fbaca9e5ab5ec2792b5de095354dfd9eb7f518 (diff)
downloadsdn-296c0cc66f5c8fe0617916a6e1faa1286146dae3.tar.gz
sdn-296c0cc66f5c8fe0617916a6e1faa1286146dae3.tar.xz
sdn-296c0cc66f5c8fe0617916a6e1faa1286146dae3.zip
Fixes for previous commits
".." used to be hidden together with hidden files, and the symlink patch introduced a compiler warning.
-rw-r--r--sdn.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/sdn.cpp b/sdn.cpp
index 38ae63f..e4e7c6c 100644
--- a/sdn.cpp
+++ b/sdn.cpp
@@ -764,8 +764,9 @@ fun reload (const string &old_cwd) {
while (auto f = readdir (dir)) {
string name = f->d_name;
// Two dots are for navigation but this ain't as useful
- if (name != "." && (name != ".." || g.cwd != "/")
- && (name[0] != '.' || g.show_hidden))
+ if (name == ".")
+ continue;
+ if (name == ".." ? g.cwd != "/" : (name[0] != '.' || g.show_hidden))
g.entries.push_back (make_entry (f));
}
closedir (dir);
@@ -1003,7 +1004,7 @@ fun change_dir (const string &path) {
explode_path (absolutize (g.cwd, path), in);
// Paths with exactly two leading slashes may get special treatment
- int startempty = 1;
+ size_t startempty = 1;
if (in.size () >= 2 && in[1] == "" && (in.size () < 3 || in[2] != ""))
startempty = 2;