wdye: improve portability
This commit is contained in:
parent
e40d56152d
commit
5c02778ff8
@ -19,7 +19,10 @@ pkg_search_module (lua REQUIRED
|
|||||||
|
|
||||||
option (WITH_CURSES "Offer terminal sequences using Curses" "${CURSES_FOUND}")
|
option (WITH_CURSES "Offer terminal sequences using Curses" "${CURSES_FOUND}")
|
||||||
|
|
||||||
include_directories ("${PROJECT_BINARY_DIR}")
|
# -liconv may or may not be a part of libc
|
||||||
|
find_path (iconv_INCLUDE_DIRS iconv.h)
|
||||||
|
|
||||||
|
include_directories ("${PROJECT_BINARY_DIR}" ${iconv_INCLUDE_DIRS})
|
||||||
file (CONFIGURE OUTPUT "${PROJECT_BINARY_DIR}/config.h" CONTENT [[
|
file (CONFIGURE OUTPUT "${PROJECT_BINARY_DIR}/config.h" CONTENT [[
|
||||||
#define PROGRAM_NAME "${PROJECT_NAME}"
|
#define PROGRAM_NAME "${PROJECT_NAME}"
|
||||||
#define PROGRAM_VERSION "${PROJECT_VERSION}"
|
#define PROGRAM_VERSION "${PROJECT_VERSION}"
|
||||||
|
@ -73,7 +73,7 @@ execvpe (const char *file, char *const argv[], char *const envp[])
|
|||||||
|
|
||||||
// This is a particularly inefficient algorithm, but it can match binary data.
|
// This is a particularly inefficient algorithm, but it can match binary data.
|
||||||
static const char *
|
static const char *
|
||||||
memmem (const struct str *haystack, const struct str *needle, bool nocase)
|
str_memmem (const struct str *haystack, const struct str *needle, bool nocase)
|
||||||
{
|
{
|
||||||
if (haystack->len < needle->len)
|
if (haystack->len < needle->len)
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -999,7 +999,7 @@ pattern_match (struct pattern *self)
|
|||||||
}
|
}
|
||||||
case PATTERN_EXACT:
|
case PATTERN_EXACT:
|
||||||
{
|
{
|
||||||
const char *match = memmem (buffer, &self->exact, self->nocase);
|
const char *match = str_memmem (buffer, &self->exact, self->nocase);
|
||||||
if (!match)
|
if (!match)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user