git-svn-id: file:///var/lib/svn/clamav-devel/branches/clamd-proto@4610 77e5149b-7576-45b1-b177-96237e5ba77b
aCaB authored on 2009/01/14 11:45:38... | ... |
@@ -90,23 +90,30 @@ static int dsresult(int sockd, const char *scantype, const char *filename, const |
90 | 90 |
break; |
91 | 91 |
} |
92 | 92 |
while(r && (eol = memchr(pt, 0, r))) { |
93 |
- if(bol-eol > 7) { |
|
94 |
- eol[-7] = '\0'; |
|
95 |
- if(!memcmp(eol - 7, ": FOUND", 7)) { |
|
93 |
+ if(eol-bol > 7) { |
|
94 |
+ if(!memcmp(eol - 6, " FOUND", 7)) { |
|
96 | 95 |
infected++; |
97 |
- logg("%s", bol); |
|
96 |
+ logg("%s\n", bol); |
|
98 | 97 |
if(optget(opts, "move")->enabled || optget(opts, "copy")->enabled) { |
99 |
- move_infected(bol, opts); |
|
98 |
+ char *com = strrchr(bol, ':'); |
|
99 |
+ if(com) { |
|
100 |
+ *com = '\0'; |
|
101 |
+ move_infected(bol, opts); |
|
102 |
+ } |
|
100 | 103 |
} else if(optget(opts, "remove")->enabled) { |
101 |
- if(unlink(bol)) { |
|
102 |
- logg("!%s: Can't remove.\n", bol); |
|
103 |
- notremoved++; |
|
104 |
- } else { |
|
105 |
- logg("~%s: Removed.\n", bol); |
|
104 |
+ char *com = strrchr(bol, ':'); |
|
105 |
+ if(com) { |
|
106 |
+ *com = '\0'; |
|
107 |
+ if(unlink(bol)) { |
|
108 |
+ logg("!%s: Can't remove.\n", bol); |
|
109 |
+ notremoved++; |
|
110 |
+ } else { |
|
111 |
+ logg("~%s: Removed.\n", bol); |
|
112 |
+ } |
|
106 | 113 |
} |
107 | 114 |
} |
108 | 115 |
} else if(memcmp(eol-7, ": ERROR", 7)) { |
109 |
- logg("~%s", bol); |
|
116 |
+ logg("~%s\n", bol); |
|
110 | 117 |
waserror = 1; |
111 | 118 |
} |
112 | 119 |
} |