diff options
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | types.c | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 1452631..d34d79e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,7 @@ OPTION(UCI_SUPPORT "UCI plugin support" ON) OPTION(LEGACY_SUPPORT "Support deprecated syntax features" ON) -SET(LIB_SEARCH_PATH "/usr/lib/ucode/*.so:/usr/share/ucode/*.uc:./*.so:./*.uc" CACHE STRING "Default library search path") +SET(LIB_SEARCH_PATH "${CMAKE_INSTALL_PREFIX}/lib/ucode/*.so:${CMAKE_INSTALL_PREFIX}/share/ucode/*.uc:./*.so:./*.uc" CACHE STRING "Default library search path") ADD_DEFINITIONS(-DLIB_SEARCH_PATH="${LIB_SEARCH_PATH}") IF(NOT APPLE) @@ -699,13 +699,18 @@ bool ucv_array_set(uc_value_t *uv, size_t index, uc_value_t *item) { uc_array_t *array = (uc_array_t *)uv; + size_t old_count; if (ucv_type(uv) != UC_ARRAY) return false; if (index >= array->count) { + old_count = array->count; array->count = index + 1; uc_vector_grow(array); + + while (old_count < array->count) + array->entries[old_count++] = NULL; } else { ucv_put(array->entries[index]); |