cmark

My personal build of CMark ✏️

Commit
4af0266a3540f9b8178105e30c501f4f9b6b697f
Parent
96bda566ccf21b7762757fb745f1fc0031e89476
Author
John MacFarlane <jgm@berkeley.edu>
Date

Merge pull request #107 from krytarowski/netbsd-support-1

NetBSD build fixes

Diffstat

2 files changed, 7 insertions, 5 deletions

Status File Name N° Changes Insertions Deletions
Modified man/CMakeLists.txt 8 5 3
Modified src/commonmark.c 4 2 2
diff --git a/man/CMakeLists.txt b/man/CMakeLists.txt
@@ -1,8 +1,10 @@
 if (NOT MSVC)
+
+include(GNUInstallDirs)
+
   install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/man1/cmark.1
-    DESTINATION share/man/man1)
+    DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
 
   install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/man3/cmark.3
-    DESTINATION share/man/man3)
+    DESTINATION ${CMAKE_INSTALL_MANDIR}/man3)
 endif(NOT MSVC)
-
diff --git a/src/commonmark.c b/src/commonmark.c
@@ -273,8 +273,8 @@ static int S_render_node(cmark_renderer *renderer, cmark_node *node,
     // begin or end with a blank line, and code isn't
     // first thing in a list item
     if (info_len == 0 &&
-        (code_len > 2 && !isspace(code[0]) &&
-         !(isspace(code[code_len - 1]) && isspace(code[code_len - 2]))) &&
+        (code_len > 2 && !isspace((unsigned char)code[0]) &&
+         !(isspace((unsigned char)code[code_len - 1]) && isspace((unsigned char)code[code_len - 2]))) &&
         !(node->prev == NULL && node->parent &&
           node->parent->type == CMARK_NODE_ITEM)) {
       LIT("    ");