version 1.29, 2014/04/15 23:48:51 |
version 1.31, 2014/04/16 00:33:47 |
Line 210 mansearch(const struct mansearch *search, |
|
Line 210 mansearch(const struct mansearch *search, |
|
*/ |
*/ |
|
|
if (NULL == getcwd(buf, PATH_MAX)) { |
if (NULL == getcwd(buf, PATH_MAX)) { |
perror(NULL); |
perror("getcwd"); |
goto out; |
goto out; |
} else if (-1 == (fd = open(buf, O_RDONLY, 0))) { |
} else if (-1 == (fd = open(buf, O_RDONLY, 0))) { |
perror(buf); |
perror(buf); |
Line 218 mansearch(const struct mansearch *search, |
|
Line 218 mansearch(const struct mansearch *search, |
|
} |
} |
|
|
sql = sql_statement(e); |
sql = sql_statement(e); |
printf("%s\n", sql); |
|
|
|
/* |
/* |
* Loop over the directories (containing databases) for us to |
* Loop over the directories (containing databases) for us to |
Line 254 mansearch(const struct mansearch *search, |
|
Line 253 mansearch(const struct mansearch *search, |
|
*/ |
*/ |
|
|
c = sqlite3_create_function(db, "match", 2, |
c = sqlite3_create_function(db, "match", 2, |
SQLITE_ANY, NULL, sql_match, NULL, NULL); |
SQLITE_UTF8 | SQLITE_DETERMINISTIC, |
|
NULL, sql_match, NULL, NULL); |
assert(SQLITE_OK == c); |
assert(SQLITE_OK == c); |
c = sqlite3_create_function(db, "regexp", 2, |
c = sqlite3_create_function(db, "regexp", 2, |
SQLITE_ANY, NULL, sql_regexp, NULL, NULL); |
SQLITE_UTF8 | SQLITE_DETERMINISTIC, |
|
NULL, sql_regexp, NULL, NULL); |
assert(SQLITE_OK == c); |
assert(SQLITE_OK == c); |
|
|
j = 1; |
j = 1; |
Line 348 mansearch(const struct mansearch *search, |
|
Line 349 mansearch(const struct mansearch *search, |
|
} |
} |
rc = 1; |
rc = 1; |
out: |
out: |
exprfree(e); |
if (-1 != fd) { |
if (-1 != fd) |
if (-1 == fchdir(fd)) |
|
perror(buf); |
close(fd); |
close(fd); |
|
} |
|
exprfree(e); |
free(sql); |
free(sql); |
*sz = cur; |
*sz = cur; |
return(rc); |
return(rc); |