Dolda2000 GitWeb
/
ashd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a39d9e1
)
dirplex: Ignore backup files.
author
Fredrik Tolf
<fredrik@dolda2000.com>
Wed, 1 Sep 2010 00:31:34 +0000
(
02:31
+0200)
committer
Fredrik Tolf
<fredrik@dolda2000.com>
Wed, 1 Sep 2010 00:36:10 +0000
(
02:36
+0200)
src/dirplex.c
patch
|
blob
|
blame
|
history
diff --git
a/src/dirplex.c
b/src/dirplex.c
index
8e4ae11
..
75ff4a4
100644
(file)
--- a/
src/dirplex.c
+++ b/
src/dirplex.c
@@
-466,6
+466,11
@@
static void handledir(struct hthead *req, int fd, char *path)
ipath = NULL;
if(!strchr(inm, '.') && ((dir = opendir(path)) != NULL)) {
while((dent = readdir(dir)) != NULL) {
ipath = NULL;
if(!strchr(inm, '.') && ((dir = opendir(path)) != NULL)) {
while((dent = readdir(dir)) != NULL) {
+ /* Ignore backup files.
+ * XXX: There is probably a better and more
+ * extensible way to do this. */
+ if(dent->d_name[strlen(dent->d_name) - 1] == '~')
+ continue;
if((p = strchr(dent->d_name, '.')) == NULL)
continue;
if(strncmp(dent->d_name, inm, strlen(inm)))
if((p = strchr(dent->d_name, '.')) == NULL)
continue;
if(strncmp(dent->d_name, inm, strlen(inm)))
@@
-583,6
+588,11
@@
static void serve(struct hthead *req, int fd)
if(!strchr(p, '.') && ((dir = opendir(path)) != NULL)) {
while((dent = readdir(dir)) != NULL) {
buf = sprintf3("%s/%s", path, dent->d_name);
if(!strchr(p, '.') && ((dir = opendir(path)) != NULL)) {
while((dent = readdir(dir)) != NULL) {
buf = sprintf3("%s/%s", path, dent->d_name);
+ /* Ignore backup files.
+ * XXX: There is probably a better and more
+ * extensible way to do this. */
+ if(dent->d_name[strlen(dent->d_name) - 1] == '~')
+ continue;
if((p3 = strchr(dent->d_name, '.')) != NULL)
*p3 = 0;
if(strcmp(dent->d_name, p))
if((p3 = strchr(dent->d_name, '.')) != NULL)
*p3 = 0;
if(strcmp(dent->d_name, p))