fix #ifdefs so that nano compiles with NANO_SMALL defined and
DISABLE_TABCOMP undefined git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2670 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
2515ccc0a0
commit
ab41ab9246
|
@ -79,6 +79,9 @@ CVS code -
|
||||||
is_punct_mbchar() and is_word_mbchar(); changes to
|
is_punct_mbchar() and is_word_mbchar(); changes to
|
||||||
do_next_word(), do_prev_word(), is_whole_word(),
|
do_next_word(), do_prev_word(), is_whole_word(),
|
||||||
do_statusbar_next_word(), and do_statusbar_prev_word(). (DLR)
|
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:
|
- chars.c:
|
||||||
make_mbstring()
|
make_mbstring()
|
||||||
- Change erroneous ENABLE_EXTRA #ifdef to NANO_EXTRA to fix a
|
- Change erroneous ENABLE_EXTRA #ifdef to NANO_EXTRA to fix a
|
||||||
|
|
|
@ -597,8 +597,7 @@ const char *mbstrcasestr(const char *haystack, const char *needle)
|
||||||
return strcasestr(haystack, needle);
|
return strcasestr(haystack, needle);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NANO_SMALL
|
#if !defined(NANO_SMALL) || !defined(DISABLE_TABCOMP)
|
||||||
#ifndef DISABLE_TABCOMP
|
|
||||||
/* This function is equivalent to strstr(), except in that it scans the
|
/* This function is equivalent to strstr(), except in that it scans the
|
||||||
* string in reverse, starting at rev_start. */
|
* string in reverse, starting at rev_start. */
|
||||||
const char *revstrstr(const char *haystack, const char *needle, const
|
const char *revstrstr(const char *haystack, const char *needle, const
|
||||||
|
@ -618,8 +617,9 @@ const char *revstrstr(const char *haystack, const char *needle, const
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
#endif /* !DISABLE_TABCOMP */
|
#endif /* !NANO_SMALL || !DISABLE_TABCOMP */
|
||||||
|
|
||||||
|
#ifndef NANO_SMALL
|
||||||
/* This function is equivalent to strcasestr(), except in that it scans
|
/* This function is equivalent to strcasestr(), except in that it scans
|
||||||
* the string in reverse, starting at rev_start. */
|
* the string in reverse, starting at rev_start. */
|
||||||
const char *revstrcasestr(const char *haystack, const char *needle,
|
const char *revstrcasestr(const char *haystack, const char *needle,
|
||||||
|
|
26
src/files.c
26
src/files.c
|
@ -2010,6 +2010,15 @@ int diralphasort(const void *va, const void *vb)
|
||||||
|
|
||||||
return strcasecmp(a, b);
|
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
|
#endif
|
||||||
|
|
||||||
#ifndef DISABLE_TABCOMP
|
#ifndef DISABLE_TABCOMP
|
||||||
|
@ -2337,7 +2346,7 @@ char *input_tab(char *buf, size_t *place, bool *lastwastab, bool *list)
|
||||||
free(mzero);
|
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
|
/* Only refresh the edit window if we don't have a list of filename
|
||||||
* matches on it. */
|
* matches on it. */
|
||||||
|
@ -2366,15 +2375,6 @@ const char *tail(const char *foo)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef DISABLE_BROWSER
|
#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. */
|
/* Strip one directory from the end of path. */
|
||||||
void striponedir(char *path)
|
void striponedir(char *path)
|
||||||
{
|
{
|
||||||
|
@ -2651,7 +2651,7 @@ char *do_browser(char *path, DIR *dir)
|
||||||
path = mallocstrcpy(path, filelist[selected]);
|
path = mallocstrcpy(path, filelist[selected]);
|
||||||
|
|
||||||
/* Start over again with the new path value. */
|
/* Start over again with the new path value. */
|
||||||
free_charptrarray(filelist, numents);
|
free_chararray(filelist, numents);
|
||||||
goto change_browser_directory;
|
goto change_browser_directory;
|
||||||
|
|
||||||
/* Refresh the screen. */
|
/* Refresh the screen. */
|
||||||
|
@ -2711,7 +2711,7 @@ char *do_browser(char *path, DIR *dir)
|
||||||
/* Start over again with the new path value. */
|
/* Start over again with the new path value. */
|
||||||
free(path);
|
free(path);
|
||||||
path = new_path;
|
path = new_path;
|
||||||
free_charptrarray(filelist, numents);
|
free_chararray(filelist, numents);
|
||||||
goto change_browser_directory;
|
goto change_browser_directory;
|
||||||
|
|
||||||
/* Abort the browser. */
|
/* Abort the browser. */
|
||||||
|
@ -2821,7 +2821,7 @@ char *do_browser(char *path, DIR *dir)
|
||||||
SET(CONSTUPDATE);
|
SET(CONSTUPDATE);
|
||||||
|
|
||||||
/* Clean up. */
|
/* Clean up. */
|
||||||
free_charptrarray(filelist, numents);
|
free_chararray(filelist, numents);
|
||||||
free(path);
|
free(path);
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
|
|
|
@ -199,11 +199,11 @@ int mbstrncasecmp(const char *s1, const char *s2, size_t n);
|
||||||
const char *nstrcasestr(const char *haystack, const char *needle);
|
const char *nstrcasestr(const char *haystack, const char *needle);
|
||||||
#endif
|
#endif
|
||||||
const char *mbstrcasestr(const char *haystack, const char *needle);
|
const char *mbstrcasestr(const char *haystack, const char *needle);
|
||||||
#ifndef NANO_SMALL
|
#if !defined(NANO_SMALL) || !defined(DISABLE_TABCOMP)
|
||||||
#ifndef DISABLE_TABCOMP
|
|
||||||
const char *revstrstr(const char *haystack, const char *needle, const
|
const char *revstrstr(const char *haystack, const char *needle, const
|
||||||
char *rev_start);
|
char *rev_start);
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef NANO_SMALL
|
||||||
const char *revstrcasestr(const char *haystack, const char *needle,
|
const char *revstrcasestr(const char *haystack, const char *needle,
|
||||||
const char *rev_start);
|
const char *rev_start);
|
||||||
const char *mbrevstrcasestr(const char *haystack, const char *needle,
|
const char *mbrevstrcasestr(const char *haystack, const char *needle,
|
||||||
|
@ -305,6 +305,7 @@ void do_writeout_void(void);
|
||||||
char *real_dir_from_tilde(const char *buf);
|
char *real_dir_from_tilde(const char *buf);
|
||||||
#if !defined(DISABLE_TABCOMP) || !defined(DISABLE_BROWSER)
|
#if !defined(DISABLE_TABCOMP) || !defined(DISABLE_BROWSER)
|
||||||
int diralphasort(const void *va, const void *vb);
|
int diralphasort(const void *va, const void *vb);
|
||||||
|
void free_chararray(char **array, size_t len);
|
||||||
#endif
|
#endif
|
||||||
#ifndef DISABLE_TABCOMP
|
#ifndef DISABLE_TABCOMP
|
||||||
char **username_tab_completion(const char *buf, size_t *num_matches,
|
char **username_tab_completion(const char *buf, size_t *num_matches,
|
||||||
|
@ -315,7 +316,6 @@ char *input_tab(char *buf, size_t *place, bool *lastwastab, bool *list);
|
||||||
#endif
|
#endif
|
||||||
const char *tail(const char *foo);
|
const char *tail(const char *foo);
|
||||||
#ifndef DISABLE_BROWSER
|
#ifndef DISABLE_BROWSER
|
||||||
void free_charptrarray(char **array, size_t len);
|
|
||||||
void striponedir(char *path);
|
void striponedir(char *path);
|
||||||
char **browser_init(const char *path, int *longest, size_t *numents, DIR
|
char **browser_init(const char *path, int *longest, size_t *numents, DIR
|
||||||
*dir);
|
*dir);
|
||||||
|
|
Loading…
Reference in New Issue