only when there are at least 2 chars in pathname.

git-svn: trunk@4853
0.95
Török Edvin 16 years ago
parent a1598d7ccb
commit 56c97aa050
  1. 5
      ChangeLog
  2. 4
      libclamav/others_common.c

@ -1,3 +1,8 @@
Tue Feb 24 15:57:43 EET 2009 (edwin)
------------------------------------
* libclamav/others_common.c: only when there are at least 2 chars in
pathname.
Tue Feb 24 15:54:17 EET 2009 (edwin)
------------------------------------
* clamdscan/client.c, clamdscan/proto.c, clamdscan/proto.h,

@ -505,10 +505,10 @@ int cli_ftw(char *path, int flags, int maxdepth, cli_ftw_cb callback, struct cli
int ret;
if (flags & CLI_FTW_TRIM_SLASHES) {
if ((flags & CLI_FTW_TRIM_SLASHES) && path[0] && path[1]) {
char *pathend;
/* trim slashes so that dir and dir/ behave the same when
* they are symlinks, and we are not following symlinks */
char *pathend;
while (path[0] == '/' && path[1] == '/') path++;
pathend = path + strlen(path);
while (pathend > path && pathend[-1] == '/') --pathend;

Loading…
Cancel
Save