Switch to unified view

a/src/utils/idfile.cpp b/src/utils/idfile.cpp
1
#ifndef lint
1
#ifndef lint
2
static char rcsid[] = "@(#$Id: idfile.cpp,v 1.6 2007-12-13 06:58:22 dockes Exp $ (C) 2005 J.F.Dockes";
2
static char rcsid[] = "@(#$Id: idfile.cpp,v 1.7 2008-02-11 10:21:58 dockes Exp $ (C) 2005 J.F.Dockes";
3
#endif
3
#endif
4
/*
4
/*
5
 *   This program is free software; you can redistribute it and/or modify
5
 *   This program is free software; you can redistribute it and/or modify
6
 *   it under the terms of the GNU General Public License as published by
6
 *   it under the terms of the GNU General Public License as published by
7
 *   the Free Software Foundation; either version 2 of the License, or
7
 *   the Free Software Foundation; either version 2 of the License, or
...
...
56
56
57
const int wantnhead = 3;
57
const int wantnhead = 3;
58
58
59
string idFile(const char *fn)
59
string idFile(const char *fn)
60
{
60
{
61
    static int treat_mbox_as_rfc822;
62
    if (treat_mbox_as_rfc822 == 0) {
63
  treat_mbox_as_rfc822 = getenv("RECOLL_TREAT_MBOX_AS_RFC822") ? 1 : -1;
64
    }
65
61
    ifstream input;
66
    ifstream input;
62
    input.open(fn, ios::in);
67
    input.open(fn, ios::in);
63
    if (!input.is_open()) {
68
    if (!input.is_open()) {
64
    LOGERR(("idFile: could not open [%s]\n", fn));
69
    LOGERR(("idFile: could not open [%s]\n", fn));
65
    return string("");
70
    return string("");
...
...
118
        return string("");
123
        return string("");
119
    }
124
    }
120
125
121
    // Check for mbox 'From ' line
126
    // Check for mbox 'From ' line
122
    if (lnum == 1 && !strncmp("From ", cline, 5)) {
127
    if (lnum == 1 && !strncmp("From ", cline, 5)) {
128
      if (treat_mbox_as_rfc822 == -1)
123
        line1HasFrom = true;
129
      line1HasFrom = true;
124
        continue;
130
        continue;
125
    } 
131
    } 
126
132
127
    // Except for a possible first line with 'From ', lines must
133
    // Except for a possible first line with 'From ', lines must
128
    // begin with whitespace or have a colon 
134
    // begin with whitespace or have a colon