Browse Source

Fixes for previous commits

".." used to be hidden together with hidden files,
and the symlink patch introduced a compiler warning.
Přemysl Janouch 1 month ago
parent
commit
296c0cc66f
Signed by: Přemysl Janouch <p@janouch.name> GPG Key ID: A0420B94F92B9493
1 changed files with 4 additions and 3 deletions
  1. 4
    3
      sdn.cpp

+ 4
- 3
sdn.cpp View File

@@ -764,8 +764,9 @@ fun reload (const string &old_cwd) {
764 764
 	while (auto f = readdir (dir)) {
765 765
 		string name = f->d_name;
766 766
 		// Two dots are for navigation but this ain't as useful
767
-		if (name != "." && (name != ".." || g.cwd != "/")
768
-		 && (name[0] != '.' || g.show_hidden))
767
+		if (name == ".")
768
+			continue;
769
+		if (name == ".." ? g.cwd != "/" : (name[0] != '.' || g.show_hidden))
769 770
 			g.entries.push_back (make_entry (f));
770 771
 	}
771 772
 	closedir (dir);
@@ -1003,7 +1004,7 @@ fun change_dir (const string &path) {
1003 1004
 	explode_path (absolutize (g.cwd, path), in);
1004 1005
 
1005 1006
 	// Paths with exactly two leading slashes may get special treatment
1006
-	int startempty = 1;
1007
+	size_t startempty = 1;
1007 1008
 	if (in.size () >= 2 && in[1] == "" && (in.size () < 3 || in[2] != ""))
1008 1009
 		startempty = 2;
1009 1010
 

Loading…
Cancel
Save