~ubuntu-branches/ubuntu/trusty/recoll/trusty

« back to all changes in this revision

Viewing changes to utils/idfile.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Kartik Mistry
  • Date: 2008-05-29 23:25:40 UTC
  • mfrom: (1.1.5 upstream) (4.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080529232540-9kuyznin2g8zmjn9
Tags: 1.10.2-1
* New upstream release
  + Updated patch debian/patches/02_gcc-snapshot-missing-headers-fix.dpatch
    Some portions are now merged with upstream
* debian/copyright:
  + Fixed indentation to 80 characters
  + Updated Debian package copyright year

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
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.8 2008/05/21 07:21:37 dockes Exp $ (C) 2005 J.F.Dockes";
3
3
#endif
4
4
/*
5
5
 *   This program is free software; you can redistribute it and/or modify
19
19
 */
20
20
#ifndef TEST_IDFILE
21
21
#include <unistd.h> // for access(2)
 
22
#include <stdlib.h>
22
23
#include <ctype.h>
23
24
#include <cstring>
24
25
 
58
59
 
59
60
string idFile(const char *fn)
60
61
{
 
62
    static int treat_mbox_as_rfc822;
 
63
    if (treat_mbox_as_rfc822 == 0) {
 
64
        treat_mbox_as_rfc822 = getenv("RECOLL_TREAT_MBOX_AS_RFC822") ? 1 : -1;
 
65
    }
 
66
 
61
67
    ifstream input;
62
68
    input.open(fn, ios::in);
63
69
    if (!input.is_open()) {
120
126
 
121
127
        // Check for mbox 'From ' line
122
128
        if (lnum == 1 && !strncmp("From ", cline, 5)) {
123
 
            line1HasFrom = true;
 
129
            if (treat_mbox_as_rfc822 == -1)
 
130
                line1HasFrom = true;
124
131
            continue;
125
132
        } 
126
133