summaryrefslogtreecommitdiff
path: root/tools/mail-scan.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/mail-scan.c')
-rw-r--r--tools/mail-scan.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/mail-scan.c b/tools/mail-scan.c
index 1ea245f..dc8aa5c 100644
--- a/tools/mail-scan.c
+++ b/tools/mail-scan.c
@@ -183,6 +183,16 @@ public:
}
};
+string noCR(const string bar){
+ string foo(bar);
+ int len = foo.length();
+ if (len){
+ if (foo[len-1] == '\r') {
+ foo.erase(len-1);
+ }
+ }
+ return foo;
+}
////////////////////////////////////////////////////////////
int main(int _argc, const char** _argv){
@@ -268,6 +278,7 @@ int main(int _argc, const char** _argv){
return 1;
}
if (getline(infile, line).fail()) continue;
+ line = noCR(line);
Header.push_back(line);
msgsize += line.length()+1;
if (msgsize > maxsize) {
@@ -335,6 +346,7 @@ int main(int _argc, const char** _argv){
break;
}
} // end loop over matching records in this file
+
if (vflag && !foundsome_infile) {
cout << *file << endl;
didprint++;