Commit Diff


commit - 58b141cfaab7898107a6c4bc674ddfacf46ce267
commit + 12bfa80e246ba9d8f580cd2d8fca7e6230a38e86
blob - 4d41a34c5e4e357eb7c5d451e6f5d845656da0d8
blob + 0175181602059aa3e308ec118b937ad8928f75c0
--- kamiftp/ftp.c
+++ kamiftp/ftp.c
@@ -1021,17 +1021,20 @@ int
 dir_listing(const char *path, int (*fn)(const struct np_stat *),
     int printerr)
 {
-	struct qid	 qid;
+	struct qid	 qid = {0, 0, QTDIR};
 	struct np_stat	 st;
 	uint64_t	 off = 0;
 	uint32_t	 len;
-	int		 nfid, miss, r;
+	int		 nfid, r, miss = 0;
 	char		*errstr;
 
 	now = time(NULL);
 	nfid = nextfid();
 
-	errstr = walk_path(pwdfid, nfid, path, &miss, &qid);
+	if (!strcmp(path, "."))
+		errstr = dup_fid(pwdfid, nfid);
+	else
+		errstr = walk_path(pwdfid, nfid, path, &miss, &qid);
 	if (errstr != NULL) {
 		if (printerr)
 			printf("%s: %s\n", path, errstr);