more minor cosmetic fixes

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1995 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
David Lawrence Ramsey 2004-10-16 15:41:57 +00:00
parent 439fbe3e93
commit 6be5339265
2 changed files with 39 additions and 43 deletions

View File

@ -31,7 +31,6 @@
#include "proto.h"
#include "nano.h"
#ifdef HAVE_REGEX_H
static int regexp_compiled = FALSE;
@ -102,14 +101,10 @@ void search_abort(void)
void search_init_globals(void)
{
if (last_search == NULL) {
last_search = charalloc(1);
last_search[0] = '\0';
}
if (last_replace == NULL) {
last_replace = charalloc(1);
last_replace[0] = '\0';
}
if (last_search == NULL)
last_search = mallocstrcpy(NULL, "");
if (last_replace == NULL)
last_replace = mallocstrcpy(NULL, "");
}
/* Set up the system variables for a search or replace. If use_answer
@ -533,7 +528,8 @@ int replace_regexp(char *string, bool create_flag)
while (*c != '\0') {
int num = (int)(*(c + 1) - '0');
if (*c != '\\' || num < 1 || num > 9 || num > search_regexp.re_nsub) {
if (*c != '\\' || num < 1 || num > 9 || num >
search_regexp.re_nsub) {
if (create_flag)
*string++ = *c;
c++;

View File

@ -45,7 +45,7 @@ int regexec_safe(const regex_t *preg, const char *string, size_t nmatch,
#endif /* BROKEN_REGEXEC */
/* Assume that string will be found by regexec() if the REG_NOTBOL and
* REG_NOTEOL glags are not set. */
* REG_NOTEOL flags are not set. */
int regexp_bol_or_eol(const regex_t *preg, const char *string)
{
return (regexec(preg, string, 0, NULL, REG_NOTBOL | REG_NOTEOL) ==