2 make this patch smarter, combine the parsing into common place
3 perhaps even make it configurable (so upstream would accept it)
5 --- incron-0.5.10/usertable.cpp 2012-04-07 01:19:27.000000000 +0300
6 +++ incron-0.5.10.glen/usertable.cpp 2012-10-21 19:06:15.091453806 +0300
10 else if (!e.GetName().empty()) {
11 + const char *fn = e.GetName().c_str();
12 + size_t len = strlen(fn);
15 + * skip file names beginning with "." or "#" to skip hidden files
17 + if (fn[0] == '.' || fn[0] == '#') {
21 + /* ignore files ending with '~' */
22 + if (fn[len - 1] == '~') {
26 + /* ignore *.rpmnew, *.rpmsave and *.rpmorig files */
27 + if ((len > 7 && strstr(&fn[len - 7], ".rpmnew")) ||
28 + (len > 8 && strstr(&fn[len - 8], ".rpmsave")) ||
29 + (len > 8 && strstr(&fn[len - 8], ".rpmorig"))) {
33 SUT_MAP::iterator it = g_ut.find(IncronCfg::BuildPath(m_pSys->GetPath(), e.GetName()));
34 if (it != g_ut.end()) {
35 UserTable* pUt = (*it).second;
36 --- incron-0.5.10/icd-main.cpp~ 2012-10-21 19:15:17.000000000 +0300
37 +++ incron-0.5.10/icd-main.cpp 2012-10-21 19:19:01.599754423 +0300
39 struct dirent* pDe = NULL;
40 while ((pDe = readdir(d)) != NULL) {
41 std::string un(pDe->d_name);
42 - std::string path(IncronCfg::BuildPath(s, pDe->d_name));
44 + std::string path(IncronCfg::BuildPath(s, pDe->d_name));
46 + const char *fn = pDe->d_name;
47 + size_t len = strlen(fn);
50 + * skip file names beginning with "." or "#" to skip hidden files
52 + if (fn[0] == '.' || fn[0] == '#') {
56 + /* ignore files ending with '~' */
57 + if (fn[len - 1] == '~') {
61 + /* ignore *.rpmnew, *.rpmsave and *.rpmorig files */
62 + if ((len > 7 && strstr(&fn[len - 7], ".rpmnew")) ||
63 + (len > 8 && strstr(&fn[len - 8], ".rpmsave")) ||
64 + (len > 8 && strstr(&fn[len - 8], ".rpmorig"))) {
68 bool ok = pDe->d_type == DT_REG;
69 if (pDe->d_type == DT_UNKNOWN) {