Changeset 4482


Ignore:
Timestamp:
Feb 9, 2015, 7:05:15 AM (5 years ago)
Author:
cameron
Message:

Ensure line breaks are not matched.

Location:
icGREP/icgrep-devel/icgrep
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/do_grep.cpp

    r4478 r4482  
    183183    mFileBuffer = (char *) mmap(NULL, mFileSize + mmap_sentinel_bytes, PROT_READ|PROT_WRITE, MAP_PRIVATE, fdSrc, 0);
    184184    if (mFileBuffer == MAP_FAILED) {
    185         std::cerr << "Error: mmap of " << infilename << " failed. Skipped.\n";
     185        if (errno ==  ENOMEM) {
     186            std::cerr << "Error:  mmap of " << infilename << " failed: out of memory\n";
     187        }
     188        else {
     189            std::cerr << "Error: mmap of " << infilename << " failed with errno " << errno << ". Skipped.\n";
     190        }
    186191        return;
    187192    }
  • icGREP/icgrep-devel/icgrep/re/re_compiler.cpp

    r4459 r4482  
    170170            assert(markerPos(m) == FinalMatchByte);
    171171            PabloAST * v = markerVar(m);
     172            v = mPB.createAnd(v, mPB.createNot(UNICODE_LINE_BREAK ? mUnicodeLineBreak : mLineFeed));
    172173            name->setCompiled(v);
    173174            return v;
    174175        }
    175176        else if (name->getType() == Name::Type::UnicodeProperty) {
    176             return pb.createCall(name->getName());
     177            PabloAST * v = pb.createCall(name->getName());
     178            v = mPB.createAnd(v, mPB.createNot(UNICODE_LINE_BREAK ? mUnicodeLineBreak : mLineFeed));
     179            return v;
    177180        }
    178181        else {
Note: See TracChangeset for help on using the changeset viewer.