is_punct_mbchar() and is_word_mbchar(); changes to
do_next_word(), do_prev_word(), is_whole_word(),
do_statusbar_next_word(), and do_statusbar_prev_word(). (DLR)
+ - Fix #ifdefs so that nano compiles with NANO_SMALL defined and
+ DISABLE_TABCOMP undefined. Changes to revstrstr() and
+ free_charptrarray() (renamed free_chararray()). (DLR)
- chars.c:
make_mbstring()
- Change erroneous ENABLE_EXTRA #ifdef to NANO_EXTRA to fix a
return strcasestr(haystack, needle);
}
-#ifndef NANO_SMALL
-#ifndef DISABLE_TABCOMP
+#if !defined(NANO_SMALL) || !defined(DISABLE_TABCOMP)
/* This function is equivalent to strstr(), except in that it scans the
* string in reverse, starting at rev_start. */
const char *revstrstr(const char *haystack, const char *needle, const
return NULL;
}
-#endif /* !DISABLE_TABCOMP */
+#endif /* !NANO_SMALL || !DISABLE_TABCOMP */
+#ifndef NANO_SMALL
/* This function is equivalent to strcasestr(), except in that it scans
* the string in reverse, starting at rev_start. */
const char *revstrcasestr(const char *haystack, const char *needle,
return strcasecmp(a, b);
}
+
+/* Free the memory allocated for array, which should contain len
+ * elements. */
+void free_chararray(char **array, size_t len)
+{
+ for (; len > 0; len--)
+ free(array[len - 1]);
+ free(array);
+}
#endif
#ifndef DISABLE_TABCOMP
free(mzero);
}
- free_charptrarray(matches, num_matches);
+ free_chararray(matches, num_matches);
/* Only refresh the edit window if we don't have a list of filename
* matches on it. */
}
#ifndef DISABLE_BROWSER
-/* Free our malloc()ed memory. */
-void free_charptrarray(char **array, size_t len)
-{
- for (; len > 0; len--)
- free(array[len - 1]);
-
- free(array);
-}
-
/* Strip one directory from the end of path. */
void striponedir(char *path)
{
path = mallocstrcpy(path, filelist[selected]);
/* Start over again with the new path value. */
- free_charptrarray(filelist, numents);
+ free_chararray(filelist, numents);
goto change_browser_directory;
/* Refresh the screen. */
/* Start over again with the new path value. */
free(path);
path = new_path;
- free_charptrarray(filelist, numents);
+ free_chararray(filelist, numents);
goto change_browser_directory;
/* Abort the browser. */
SET(CONSTUPDATE);
/* Clean up. */
- free_charptrarray(filelist, numents);
+ free_chararray(filelist, numents);
free(path);
return retval;
const char *nstrcasestr(const char *haystack, const char *needle);
#endif
const char *mbstrcasestr(const char *haystack, const char *needle);
-#ifndef NANO_SMALL
-#ifndef DISABLE_TABCOMP
+#if !defined(NANO_SMALL) || !defined(DISABLE_TABCOMP)
const char *revstrstr(const char *haystack, const char *needle, const
char *rev_start);
#endif
+#ifndef NANO_SMALL
const char *revstrcasestr(const char *haystack, const char *needle,
const char *rev_start);
const char *mbrevstrcasestr(const char *haystack, const char *needle,
char *real_dir_from_tilde(const char *buf);
#if !defined(DISABLE_TABCOMP) || !defined(DISABLE_BROWSER)
int diralphasort(const void *va, const void *vb);
+void free_chararray(char **array, size_t len);
#endif
#ifndef DISABLE_TABCOMP
char **username_tab_completion(const char *buf, size_t *num_matches,
#endif
const char *tail(const char *foo);
#ifndef DISABLE_BROWSER
-void free_charptrarray(char **array, size_t len);
void striponedir(char *path);
char **browser_init(const char *path, int *longest, size_t *numents, DIR
*dir);