merged 1.6 maint branch modifs up to MERGED_TO_TRUNK_20061130

This commit is contained in:
dockes
2006-11-30 13:38:44 +00:00
parent 03b6f05f23
commit 72fd14f208
46 changed files with 417 additions and 245 deletions
+5 -1
View File
@@ -1,5 +1,5 @@
#ifndef lint
static char rcsid[] = "@(#$Id: execmd.cpp,v 1.19 2006-10-11 16:09:45 dockes Exp $ (C) 2004 J.F.Dockes";
static char rcsid[] = "@(#$Id: execmd.cpp,v 1.20 2006-11-30 13:38:44 dockes Exp $ (C) 2004 J.F.Dockes";
#endif
/*
* This program is free software; you can redistribute it and/or modify
@@ -126,6 +126,9 @@ int ExecCmd::doexec(const string &cmd, const list<string>& args,
}
if (e.pid) {
// Ignore SIGPIPE in here.
void (*osig)(int);
osig = signal(SIGPIPE, SIG_IGN);
// Father process
if (input) {
close(e.pipein[0]);
@@ -219,6 +222,7 @@ int ExecCmd::doexec(const string &cmd, const list<string>& args,
out:
int status = -1;
signal(SIGPIPE, osig);
if (!m_cancelRequest) {
(void)waitpid(e.pid, &status, 0);
e.pid = -1;
+20 -1
View File
@@ -1,5 +1,5 @@
#ifndef lint
static char rcsid[] = "@(#$Id: mimeparse.cpp,v 1.16 2006-11-09 08:59:40 dockes Exp $ (C) 2004 J.F.Dockes";
static char rcsid[] = "@(#$Id: mimeparse.cpp,v 1.17 2006-11-30 13:38:44 dockes Exp $ (C) 2004 J.F.Dockes";
#endif
/*
* This program is free software; you can redistribute it and/or modify
@@ -723,8 +723,27 @@ time_t rfc2822DateToUxTime(const string& dt)
DATEDEB((stderr, "Tz: [%s] -> %d\n", it->c_str(), zonesecs));
nozone:
// Compute the UTC Unix time value
#ifndef sun
time_t tim = timegm(&tm);
#else
// No timegm on Sun. Use mktime, then correct for local timezone
time_t tim = mktime(&tm);
// altzone and timezone hold the difference in seconds between UTC
// and local. They are negative for places east of greenwich
//
// mktime takes our buffer to be local time, so it adds timezone
// to the conversion result (if timezone is < 0 it's currently
// earlier in greenwhich).
//
// We have to substract it back (hey! hopefully! maybe we have to
// add it). Who can really know?
tim -= timezone;
#endif
// And add in the correction from the email's Tz
tim += zonesecs;
DATEDEB((stderr, "Date: %s uxtime %ld \n", ctime(&tim), tim));
return tim;
}
+2 -2
View File
@@ -1,5 +1,5 @@
#ifndef lint
static char rcsid[] = "@(#$Id: smallut.cpp,v 1.18 2006-11-10 13:30:03 dockes Exp $ (C) 2004 J.F.Dockes";
static char rcsid[] = "@(#$Id: smallut.cpp,v 1.19 2006-11-30 13:38:44 dockes Exp $ (C) 2004 J.F.Dockes";
#endif
/*
* This program is free software; you can redistribute it and/or modify
@@ -313,7 +313,7 @@ bool stringToBool(const string &s)
int val = atoi(s.c_str());
return val ? true : false;
}
if (strchr("yYoOtT", s[0]))
if (s.find_first_of("yYtT") == 0)
return true;
return false;
}