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
1439016c
Commit
1439016c
authored
7 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: recognize the empty string as comment inhibitor, instead of NULL
parent
79971a30
master
feature/match-parens
refactor/readbility
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/nano.h
+2
-0
src/nano.h
src/rcfile.c
+1
-7
src/rcfile.c
src/text.c
+1
-2
src/text.c
with
4 additions
and
9 deletions
+4
-9
src/nano.h
View file @
1439016c
...
...
@@ -220,8 +220,10 @@ typedef struct syntaxtype {
/* The command with which to lint this type of file. */
char
*
formatter
;
/* The formatting command (for programming languages mainly). */
#ifdef ENABLE_COMMENT
char
*
comment
;
/* The line comment prefix (and postfix) for this type of file. */
#endif
colortype
*
color
;
/* The colors and their regexes used in this syntax. */
int
nmultis
;
...
...
This diff is collapsed.
Click to expand it.
src/rcfile.c
View file @
1439016c
...
...
@@ -317,8 +317,6 @@ void parse_syntax(char *ptr)
live_syntax
->
formatter
=
NULL
;
#ifdef ENABLE_COMMENT
live_syntax
->
comment
=
mallocstrcpy
(
NULL
,
GENERAL_COMMENT_CHARACTER
);
#else
live_syntax
->
comment
=
NULL
;
#endif
live_syntax
->
color
=
NULL
;
lastcolor
=
NULL
;
...
...
@@ -894,11 +892,7 @@ void pick_up_name(const char *kind, char *ptr, char **storage)
*
look
=
'\0'
;
}
if
(
*
ptr
==
'\0'
)
{
free
(
*
storage
);
*
storage
=
NULL
;
}
else
*
storage
=
mallocstrcpy
(
*
storage
,
ptr
);
*
storage
=
mallocstrcpy
(
*
storage
,
ptr
);
}
#endif
/* !DISABLE_COLOR */
...
...
This diff is collapsed.
Click to expand it.
src/text.c
View file @
1439016c
...
...
@@ -470,8 +470,7 @@ void do_comment(void)
if
(
openfile
->
syntax
)
comment_seq
=
openfile
->
syntax
->
comment
;
/* Does the syntax not allow comments? */
if
(
comment_seq
==
NULL
)
{
if
(
*
comment_seq
==
'\0'
)
{
statusbar
(
_
(
"Commenting is not supported for this file type"
));
return
;
}
...
...
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