Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
cs24-19fa
git_rec_nano
Commits
0b0ddb1e
Commit
0b0ddb1e
authored
8 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: rename a variable, chuck an assert, and frob a comment
parent
991e49a3
master
feature/match-parens
refactor/readbility
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/search.c
+7
-10
src/search.c
with
7 additions
and
10 deletions
+7
-10
src/search.c
View file @
0b0ddb1e
...
...
@@ -39,22 +39,19 @@ static bool history_changed = FALSE;
static
bool
regexp_compiled
=
FALSE
;
/* Have we compiled any regular expressions? */
/* Compile the regular expression
regexp to see if it's valid. Return
* TRUE if
it is, or
FALSE otherwise. */
/* Compile the
given
regular expression
and store it in search_regexp.
*
Return
TRUE if
the expression is valid, and
FALSE otherwise. */
bool
regexp_init
(
const
char
*
regexp
)
{
int
rc
;
assert
(
!
regexp_compiled
);
rc
=
regcomp
(
&
search_regexp
,
fixbounds
(
regexp
),
int
value
=
regcomp
(
&
search_regexp
,
fixbounds
(
regexp
),
NANO_REG_EXTENDED
|
(
ISSET
(
CASE_SENSITIVE
)
?
0
:
REG_ICASE
));
if
(
rc
!=
0
)
{
size_t
len
=
regerror
(
rc
,
&
search_regexp
,
NULL
,
0
);
/* If regex compilation failed, show the error message. */
if
(
value
!=
0
)
{
size_t
len
=
regerror
(
value
,
&
search_regexp
,
NULL
,
0
);
char
*
str
=
charalloc
(
len
);
regerror
(
rc
,
&
search_regexp
,
str
,
len
);
regerror
(
value
,
&
search_regexp
,
str
,
len
);
statusline
(
ALERT
,
_
(
"Bad regex
\"
%s
\"
: %s"
),
regexp
,
str
);
free
(
str
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help