pinosaur
/
smdp.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
70ad0f1
)
fixed other valgrind read error, ugly but works :)
author
Michael Göhler
<somebody.here@gmx.de>
Thu, 6 Nov 2014 22:47:34 +0000
(23:47 +0100)
committer
Michael Göhler
<somebody.here@gmx.de>
Thu, 6 Nov 2014 22:47:34 +0000
(23:47 +0100)
src/viewer.c
patch
|
blob
|
history
diff --git
a/src/viewer.c
b/src/viewer.c
index
df66fd5
..
574c3a0
100644
(file)
--- a/
src/viewer.c
+++ b/
src/viewer.c
@@
-612,10
+612,11
@@
void inline_display(WINDOW *window, const char *c, const int colors) {
// emphasis or code span can start after new-line or space only
// and of cause after another emphasis markup
// emphasis or code span can start after new-line or space only
// and of cause after another emphasis markup
- if(*(i - 1) == ' ' ||
- ((*(i - 1) == '_' || *(i - 1) == '*') && (*(i - 2) == ' ' || (i - 1) == c)) ||
- *i == '\\' ||
- i == c) {
+ //TODO this condition looks ugly
+ if(i == c ||
+ *(i - 1) == ' ' ||
+ ((i + 1 > c) && (*(i - 1) == '_' || *(i - 1) == '*') && (*(i - 2) == ' ' || (i - 1) == c)) ||
+ *i == '\\') {
switch(*i) {
// enable highlight
switch(*i) {
// enable highlight