# # patch "lua.cc" # from [8aeabe8c9cd52d4e97e4f89d41172fba96180ba2] # to [ce09d2e2514b6b093b2c222d0e70d8b167d45dc6] # # patch "std_hooks.lua" # from [a24b26085a5449611bb976da3f0b74200b63cfc6] # to [faebc0e3d0c114b6ad2f6787f8413570a8bb4c9c] # # patch "tests/t_mt_ignore.at" # from [674809729cde1d8060a7a8b88304bb44253e9224] # to [70d452af35a31d73ed28834e8f710d7a2220b140] # ======================================================================== --- lua.cc 8aeabe8c9cd52d4e97e4f89d41172fba96180ba2 +++ lua.cc ce09d2e2514b6b093b2c222d0e70d8b167d45dc6 @@ -605,13 +605,15 @@ const char *str = lua_tostring(L, -1); boost::cmatch what; + bool result = false; try { - lua_pushboolean(L, boost::regex_search(str, what, boost::regex(re))); - } catch(boost::bad_pattern e) { + result = boost::regex_search(str, what, boost::regex(re)); + } catch (boost::bad_pattern e) { lua_pushstring(L, e.what()); lua_error(L); return 0; } + lua_pushboolean(L, result); return 1; } ======================================================================== --- std_hooks.lua a24b26085a5449611bb976da3f0b74200b63cfc6 +++ std_hooks.lua faebc0e3d0c114b6ad2f6787f8413570a8bb4c9c @@ -94,8 +94,8 @@ if result == true then return true end else -- regex.search had a problem, warn the user their .mt-ignore file syntax is wrong - io.write("\nWARNING: the line '" .. line .. "' in your .mt-ignore file caused exception '" .. result .. "'" - .. " while matching filename '" .. name .. "', ignoring this regex for all remaining files.\n\n") + io.stderr:write("WARNING: the line '" .. line .. "' in your .mt-ignore file caused exception '" .. result .. "'" + .. " while matching filename '" .. name .. "', ignoring this regex for all remaining files.\n") table.remove(ignored_files, i) end end ======================================================================== --- tests/t_mt_ignore.at 674809729cde1d8060a7a8b88304bb44253e9224 +++ tests/t_mt_ignore.at 70d452af35a31d73ed28834e8f710d7a2220b140 @@ -12,18 +12,22 @@ *.d ]) -AT_CHECK(RAW_MONOTONE ls unknown, [], [stdout], []) +AT_CHECK(RAW_MONOTONE ls unknown, [], [stdout], [stderr]) AT_CHECK(cp stdout unknown) +AT_CHECK(cp stderr unknownerr) AT_CHECK(grep foo unknown, [], [ignore]) +AT_CHECK(grep WARNING unknownerr, [], [ignore]) AT_CHECK(grep bar unknown, [1], [ignore]) AT_CHECK(grep baz unknown, [1], [ignore]) -AT_CHECK(RAW_MONOTONE ls ignored, [], [stdout], []) +AT_CHECK(RAW_MONOTONE ls ignored, [], [stdout], [stderr]) AT_CHECK(cp stdout ignored) +AT_CHECK(cp stderr ignorederr) AT_CHECK(grep foo ignored, [1], [ignore]) +AT_CHECK(grep WARNING ignorederr, [], [ignore]) AT_CHECK(grep bar ignored, [], [ignore]) AT_CHECK(grep xyzzy ignored, [], [ignore])