]> git.tdb.fi Git - libs/core.git/blobdiff - grep.cpp
Fix a problem with MATCH_MASK handling in Regex
[libs/core.git] / grep.cpp
index eaf1663e7cf1098b42aabd4b9dc454b5f09f61e6..0a3cd8d236bb7ebd8c96c7953fc5ad6d2ebff339 100644 (file)
--- a/grep.cpp
+++ b/grep.cpp
@@ -2,7 +2,7 @@
 #include <iostream>
 #include <string>
 #include <msp/core/getopt.h>
-#include "regex.h"
+#include <msp/strings/regex.h>
 
 using namespace std;
 using namespace Msp;
@@ -14,7 +14,7 @@ int main(int argc, char **argv)
        getopt.add_option('d', "debug", debug, GetOpt::NO_ARG);
        getopt(argc, argv);
 
-       const list<string> &args=getopt.get_args();
+       const vector<string> &args=getopt.get_args();
 
        if(args.empty())
        {
@@ -22,7 +22,7 @@ int main(int argc, char **argv)
                return 1;
        }
 
-       Regex regex(argv[1]);
+       Regex regex(args[0]);
        if(debug)
                cout<<regex.disassemble();
        string line;