diff --git a/configure.ac b/configure.ac index 38eae09..d77b1e8 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# -*- Autoconf -*- +# # Process this file with autoconf to produce a configure script. # @@ -18,16 +18,17 @@ AC_PROG_CC # Mac-specific ncurses check AC_CANONICAL_HOST -case $host_os in - darwin*) - AC_CHECK_LIB(ncurses, killwchar, [], [AC_MSG_ERROR([Could not find ncurses library])]) - AC_CHECK_HEADER(curses.h) - ;; - *) - AC_CHECK_LIB(ncursesw, killwchar, [], [AC_MSG_ERROR([Could not find ncursesw library])]) +AS_CASE([$host_os], + [darwin*], + [ + AC_CHECK_LIB(ncurses, killwchar, [], [AC_MSG_ERROR([Could not find ncurses library])]) + AC_CHECK_HEADER(curses.h) + ], + [ + AC_CHECK_LIB(ncursesw, killwchar, [], [AC_MSG_ERROR([Could not find ncursesw library])]) AC_CHECK_HEADER(ncursesw/curses.h) - ;; -esac + ] +) # Checks for libraries. AC_CHECK_LIB(m, cos, [], [AC_MSG_ERROR([Could not find m library])]) diff --git a/src/hstr.c b/src/hstr.c index 5670d76..4b970aa 100644 --- a/src/hstr.c +++ b/src/hstr.c @@ -760,7 +760,7 @@ int remove_from_history_model(char *delete, Hstr *hstr) return favorites_remove(hstr->favorites, delete); } else { // raw & ranked history is pruned first as its items point to system history lines - int systemOccurences, rawOccurences=history_mgmt_remove_from_raw(delete, hstr->history); + int systemOccurences=0, rawOccurences=history_mgmt_remove_from_raw(delete, hstr->history); history_mgmt_remove_from_ranked(delete, hstr->history); if(rawOccurences) { systemOccurences=history_mgmt_remove_from_system_history(delete);