最新ルールに従う様に
このコミットが含まれているのは:
コミット
0aaf5f12b2
10
listpass.c
10
listpass.c
|
@ -18,7 +18,10 @@ void listpass(char* basePath, int level) {
|
||||||
}
|
}
|
||||||
|
|
||||||
while ((entry = readdir(dir)) != NULL) {
|
while ((entry = readdir(dir)) != NULL) {
|
||||||
if (strcmp(entry->d_name, ".") != 0 && strcmp(entry->d_name, "..") != 0) {
|
if (strcmp(entry->d_name, ".") == 0 || strcmp(entry->d_name, "..") == 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
char path[1000];
|
char path[1000];
|
||||||
int needed = snprintf(path, sizeof(path), "%s/%s", basePath, entry->d_name);
|
int needed = snprintf(path, sizeof(path), "%s/%s", basePath, entry->d_name);
|
||||||
if (needed >= (int)sizeof(path) || needed < 0) {
|
if (needed >= (int)sizeof(path) || needed < 0) {
|
||||||
|
@ -44,13 +47,10 @@ void listpass(char* basePath, int level) {
|
||||||
} else if (S_ISREG(statbuf.st_mode)) {
|
} else if (S_ISREG(statbuf.st_mode)) {
|
||||||
char* filename = entry->d_name;
|
char* filename = entry->d_name;
|
||||||
char* ext = strstr(filename, ".gpg");
|
char* ext = strstr(filename, ".gpg");
|
||||||
if (ext) {
|
if (ext) *ext = '\0';
|
||||||
*ext = '\0';
|
|
||||||
}
|
|
||||||
printf("|-- %s\n", filename);
|
printf("|-- %s\n", filename);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
closedir(dir);
|
closedir(dir);
|
||||||
}
|
}
|
||||||
|
|
読み込み中…
新しいイシューから参照