projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e75e881
)
StrBufStripSlashes() we want to _strip_ trailing slashes, not append them.
author
Wilfried Goesgens
<dothebart@citadel.org>
Thu, 22 Mar 2012 23:41:01 +0000
(
00:41
+0100)
committer
Wilfried Goesgens
<dothebart@citadel.org>
Thu, 22 Mar 2012 23:41:01 +0000
(
00:41
+0100)
libcitadel/lib/stringbuf.c
patch
|
blob
|
history
diff --git
a/libcitadel/lib/stringbuf.c
b/libcitadel/lib/stringbuf.c
index bc54f82cfa4956ec5cd819e916a5cb1ad8094daa..1219401b42c9ed1b97827ed9f8c0d6f48f9d2897 100644
(file)
--- a/
libcitadel/lib/stringbuf.c
+++ b/
libcitadel/lib/stringbuf.c
@@
-3862,7
+3862,6
@@
int FileSendChunked(FDIOBuffer *FDB, const char **Err)
int FileRecvChunked(FDIOBuffer *FDB, const char **Err)
{
-
#ifdef LINUX_SENDFILE
ssize_t sent, pipesize;
@@
-3887,6
+3886,7
@@
int FileRecvChunked(FDIOBuffer *FDB, const char **Err)
FDB->ChunkSendRemain -= sent;
return sent;
#else
+
#endif
return 0;
}
@@
-4628,9
+4628,10
@@
void StrBufStripSlashes(StrBuf *Dir, int RemoveTrailingSlash)
b++; a++;
}
}
- if ((RemoveTrailingSlash) && (*(b - 1) != '/')){
- *b = '/';
- b++;
+ if ((RemoveTrailingSlash) &&
+ (b > Dir->buf) &&
+ (*(b - 1) == '/')){
+ b--;
}
*b = '\0';
Dir->BufUsed = b - Dir->buf;