diff --git a/CMakeLists.txt b/CMakeLists.txt index f9015762..3f3152d9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,14 +8,14 @@ cmake_minimum_required (VERSION 2.6) set (My_Project_Title "MultiMarkdown") set (My_Project_Description "Lightweight markup processor to produce HTML, LaTeX, and more.") set (My_Project_Author "Fletcher T. Penney") -set (My_Project_Revised_Date "2019-12-28") +set (My_Project_Revised_Date "2020-04-10") set (My_Project_Version_Major 6) set (My_Project_Version_Minor 5) -set (My_Project_Version_Patch 1) +set (My_Project_Version_Patch 2) set (My_Project_Version "${My_Project_Version_Major}.${My_Project_Version_Minor}.${My_Project_Version_Patch}") -set (My_Project_Copyright_Date "2016 - 2019") +set (My_Project_Copyright_Date "2016 - 2020") set (My_Project_Copyright "Copyright © ${My_Project_Copyright_Date} ${My_Project_Author}.") string(TOUPPER ${My_Project_Title} My_Project_Title_Caps ) @@ -416,7 +416,7 @@ if (APPLE) if (DEFINED ZIP) set (CPACK_GENERATOR ZIP) else (DEFINED ZIP) - set (CPACK_GENERATOR PackageMaker) + set (CPACK_GENERATOR productbuild) endif (DEFINED ZIP) endif (APPLE) @@ -532,7 +532,8 @@ ADD_PUBLIC_HEADER(libMultiMarkdown Sources/libMultiMarkdown/include/token.h) ADD_PUBLIC_HEADER(libMultiMarkdown Sources/libMultiMarkdown/include/version.h) # Create a command-line app? -# if (NOT DEFINED TEST) +if(hasParent) +else() add_executable(multimarkdown Sources/libMultiMarkdown/d_string.c Sources/multimarkdown/main.c @@ -541,15 +542,17 @@ ADD_PUBLIC_HEADER(libMultiMarkdown Sources/libMultiMarkdown/include/version.h) # # Link the library to the app? target_link_libraries(multimarkdown libMultiMarkdown) -# endif() + + set_target_properties(multimarkdown PROPERTIES XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH "NO") + set_property(TARGET multimarkdown PROPERTY C_STANDARD 11) + set_property(TARGET multimarkdown PROPERTY C_STANDARD 11) +endif() # Xcode settings for fat binaries set_target_properties(libMultiMarkdown PROPERTIES XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH "NO") -set_target_properties(multimarkdown PROPERTIES XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH "NO") # Use C11 set_property(TARGET libMultiMarkdown PROPERTY C_STANDARD 11) -set_property(TARGET multimarkdown PROPERTY C_STANDARD 11) # ========================== @@ -568,10 +571,13 @@ set_property(TARGET multimarkdown PROPERTY C_STANDARD 11) # install (FILES ${public_header_files} DESTINATION local/include/libFoo) # Install MMD binary -install (TARGETS multimarkdown - DESTINATION bin - COMPONENT application -) +if(hasParent) +else() + install (TARGETS multimarkdown + DESTINATION bin + COMPONENT application + ) +endif() set (CPACK_COMPONENT_APPLICATION_DISPLAY_NAME "MultiMarkdown") set (CPACK_COMPONENT_APPLICATION_DESCRIPTION "Install the actual `multimarkdown` program.") diff --git a/DevelopmentNotes/DevelopmentNotes.epub b/DevelopmentNotes/DevelopmentNotes.epub index 2299924d..40910d8e 100644 Binary files a/DevelopmentNotes/DevelopmentNotes.epub and b/DevelopmentNotes/DevelopmentNotes.epub differ diff --git a/DevelopmentNotes/DevelopmentNotes.fodt b/DevelopmentNotes/DevelopmentNotes.fodt index f4060c12..293b8f5b 100644 --- a/DevelopmentNotes/DevelopmentNotes.fodt +++ b/DevelopmentNotes/DevelopmentNotes.fodt @@ -276,7 +276,7 @@ office:mimetype="application/vnd.oasis.opendocument.text"> MultiMarkdown v6 Development Notes Fletcher T. Penney - 2019-12-11 + 2020-04-10 dd2d8e76-dc2d-416d-9acd-5395d20871c2 @@ -763,6 +763,35 @@ TextBundle/TextPack, OpenDocument, etc. Changelog + +2020–04–10 - v 6.5.2: + + + + +FIXED: Don’t use undefined version string + + + +FIXED: Fix memory leak in ITMZ reader + + + +FIXED: Update cpack generator for macOS + + + +Fix fsf address in files licenses. + + + +Merge pull request #184 from LyesSaadi/develop + + +UPDATED: Adjust cmake to only make library when included from a parent project + + + 2019–12–28 - v 6.5.1: diff --git a/DevelopmentNotes/DevelopmentNotes.html b/DevelopmentNotes/DevelopmentNotes.html index 5b288e7a..5c140085 100644 --- a/DevelopmentNotes/DevelopmentNotes.html +++ b/DevelopmentNotes/DevelopmentNotes.html @@ -4,7 +4,7 @@ MultiMarkdown v6 Development Notes - + @@ -433,6 +433,16 @@

Dependencies/Libraries

Changelog

    +
  • 2020–04–10 - v 6.5.2:

    + +
      +
    • FIXED: Don’t use undefined version string
    • +
    • FIXED: Fix memory leak in ITMZ reader
    • +
    • FIXED: Update cpack generator for macOS
    • +
    • Fix fsf address in files licenses.
    • +
    • Merge pull request #184 from LyesSaadi/develop
    • +
    • UPDATED: Adjust cmake to only make library when included from a parent project
    • +
  • 2019–12–28 - v 6.5.1:

      diff --git a/DevelopmentNotes/DevelopmentNotes.pdf b/DevelopmentNotes/DevelopmentNotes.pdf index bf637e9c..4bbc7121 100644 Binary files a/DevelopmentNotes/DevelopmentNotes.pdf and b/DevelopmentNotes/DevelopmentNotes.pdf differ diff --git a/DevelopmentNotes/DevelopmentNotes.txt b/DevelopmentNotes/DevelopmentNotes.txt index 0c3b1b96..e8a24316 100644 --- a/DevelopmentNotes/DevelopmentNotes.txt +++ b/DevelopmentNotes/DevelopmentNotes.txt @@ -1,6 +1,6 @@ Title: MultiMarkdown v6 Development Notes Author: Fletcher T. Penney -Date: 2019-12-11 +Date: 2020-04-10 LaTeX Config: tufte-handout Base Header Level: 3 uuid: dd2d8e76-dc2d-416d-9acd-5395d20871c2 @@ -472,6 +472,16 @@ TextBundle/TextPack, OpenDocument, etc. # Changelog # +* 2020-04-10 - v 6.5.2: + + * FIXED: Don't use undefined version string + * FIXED: Fix memory leak in ITMZ reader + * FIXED: Update cpack generator for macOS + * Fix fsf address in files licenses. + * Merge pull request #184 from LyesSaadi/develop + * UPDATED: Adjust cmake to only make library when included from a parent project + + * 2019-12-28 - v 6.5.1: * FIXED: Ensure use of bash for creating AllTests.c diff --git a/QuickStart/QuickStart.epub b/QuickStart/QuickStart.epub index 199833d2..ef6bd26e 100644 Binary files a/QuickStart/QuickStart.epub and b/QuickStart/QuickStart.epub differ diff --git a/QuickStart/QuickStart.fodt b/QuickStart/QuickStart.fodt index ecbe21ba..7a698f4b 100644 --- a/QuickStart/QuickStart.fodt +++ b/QuickStart/QuickStart.fodt @@ -276,7 +276,7 @@ office:mimetype="application/vnd.oasis.opendocument.text"> MultiMarkdown v6 Quick Start Guide Fletcher T. Penney - 6.4.0 + 6.5.2 0d6313fa-9135-477e-9c14-7d62c1977833 @@ -321,7 +321,7 @@ office:mimetype="application/vnd.oasis.opendocument.text"> Introduction -Version: 6.4.0 +Version: 6.5.2 This document serves as a description of MultiMarkdown (MMD) v6, as well as a sample document to demonstrate the various features. Specifically, differences from MMD v5 will be pointed out. diff --git a/QuickStart/QuickStart.html b/QuickStart/QuickStart.html index d76ccdd0..d949e500 100644 --- a/QuickStart/QuickStart.html +++ b/QuickStart/QuickStart.html @@ -4,7 +4,7 @@ MultiMarkdown v6 Quick Start Guide - + @@ -49,7 +49,7 @@

      Introduction

      -

      Version: 6.4.0

      +

      Version: 6.5.2

      This document serves as a description of MultiMarkdown (MMD) v6, as well as a sample document to demonstrate the various features. Specifically, differences from MMD v5 will be pointed out.

      diff --git a/QuickStart/QuickStart.pdf b/QuickStart/QuickStart.pdf index 9632066c..24a468ef 100644 Binary files a/QuickStart/QuickStart.pdf and b/QuickStart/QuickStart.pdf differ diff --git a/QuickStart/QuickStart.txt b/QuickStart/QuickStart.txt index 8c2be541..d3da1cdb 100644 --- a/QuickStart/QuickStart.txt +++ b/QuickStart/QuickStart.txt @@ -1,6 +1,6 @@ Title: MultiMarkdown v6 Quick Start Guide Author: Fletcher T. Penney -Version: 6.4.0 +Version: 6.5.2 LaTeX Config: tufte-handout Base Header Level: 3 uuid: 0d6313fa-9135-477e-9c14-7d62c1977833 diff --git a/README.md b/README.md index 8efa17a6..3e31e8b8 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,9 @@ | ---------- | ------------------------- | | Title: | MultiMarkdown | | Author: | Fletcher T. Penney | -| Date: | 2019-12-28 | -| Copyright: | Copyright © 2016 - 2019 Fletcher T. Penney. | -| Version: | 6.5.1 | +| Date: | 2020-04-10 | +| Copyright: | Copyright © 2016 - 2020 Fletcher T. Penney. | +| Version: | 6.5.2 | master branch: [![Build Status](https://travis-ci.org/fletcher/MultiMarkdown-6.svg?branch=master)](https://travis-ci.org/fletcher/MultiMarkdown-6) develop branch: [![Build Status](https://travis-ci.org/fletcher/MultiMarkdown-6.svg?branch=develop)](https://travis-ci.org/fletcher/MultiMarkdown-6) diff --git a/Sources/libMultiMarkdown/itmz-reader.c b/Sources/libMultiMarkdown/itmz-reader.c index b18d7aba..adea3d50 100644 --- a/Sources/libMultiMarkdown/itmz-reader.c +++ b/Sources/libMultiMarkdown/itmz-reader.c @@ -382,5 +382,7 @@ void mmd_convert_itmz_string(mmd_engine * e, size_t start, size_t len) { // Now convert mapdata.xml -> MMD text token * chain = tokenize_itmz_string(e, 0, e->dstr->currentStringLength); parse_itmz_token_chain(e, chain); + } else { + d_string_free(text, true); } } diff --git a/Sources/libMultiMarkdown/mmd.c b/Sources/libMultiMarkdown/mmd.c index 139ac648..e6d99d96 100644 --- a/Sources/libMultiMarkdown/mmd.c +++ b/Sources/libMultiMarkdown/mmd.c @@ -3049,7 +3049,7 @@ DString * mmd_engine_convert_itmz_to_text(mmd_engine * e) { /// Return string containing engine version. char * mmd_version(void) { - char * result; + char * result = NULL; #ifndef TEST result = my_strdup(MULTIMARKDOWN_VERSION); #endif diff --git a/Sources/libMultiMarkdown/zip.c b/Sources/libMultiMarkdown/zip.c index 38790c0e..5bbeccf2 100644 --- a/Sources/libMultiMarkdown/zip.c +++ b/Sources/libMultiMarkdown/zip.c @@ -196,17 +196,21 @@ mz_bool unzip_archive_to_path(mz_zip_archive * pZip, const char * path) { // Unzip archive (as plain binary data) to specified file path mz_bool unzip_data_to_path(const void * data, size_t size, const char * path) { - mz_zip_archive pZip; - memset(&pZip, 0, sizeof(mz_zip_archive)); + mz_zip_archive * pZip = malloc(sizeof(mz_zip_archive)); + memset(pZip, 0, sizeof(mz_zip_archive)); - mz_bool status = mz_zip_reader_init_mem(&pZip, data, size, 0); + mz_bool status = mz_zip_reader_init_mem(pZip, data, size, 0); if (!status) { fprintf(stderr, "mz_zip_reader_init_mem() failed.\n"); + mz_zip_reader_end(pZip); return status; } - return unzip_archive_to_path(&pZip, path); + status = unzip_archive_to_path(pZip, path); + mz_zip_reader_end(pZip); + free(pZip); + return status; } @@ -247,22 +251,27 @@ mz_bool unzip_file_from_archive(mz_zip_archive * pZip, const char * filename, DS // Extract single file from archive mz_bool unzip_file_from_data(const void * data, size_t size, const char * filename, DString * destination) { - mz_zip_archive pZip; - memset(&pZip, 0, sizeof(mz_zip_archive)); + mz_zip_archive * pZip = malloc(sizeof(mz_zip_archive)); + memset(pZip, 0, sizeof(mz_zip_archive)); - mz_bool status = mz_zip_reader_init_mem(&pZip, data, size, 0); + mz_bool status = mz_zip_reader_init_mem(pZip, data, size, 0); if (!status) { fprintf(stderr, "mz_zip_reader_init_mem() failed.\n"); + mz_zip_reader_end(pZip); return status; } - status = mz_zip_validate_archive(&pZip, 0); + status = mz_zip_validate_archive(pZip, 0); if (!status) { fprintf(stderr, "mz_zip_validate_archive failed.\n"); + mz_zip_reader_end(pZip); return status; } - return unzip_file_from_archive(&pZip, filename, destination); + status = unzip_file_from_archive(pZip, filename, destination); + mz_zip_reader_end(pZip); + free(pZip); + return status; } diff --git a/texmf/tex/latex/mmd6/letterhead/mmd-envelope.sty b/texmf/tex/latex/mmd6/letterhead/mmd-envelope.sty index a2e633f4..64c816e6 100644 --- a/texmf/tex/latex/mmd6/letterhead/mmd-envelope.sty +++ b/texmf/tex/latex/mmd6/letterhead/mmd-envelope.sty @@ -23,8 +23,8 @@ % You should have received a copy of the GNU General Public License % along with this program; if not, write to the % Free Software Foundation, Inc. -% 59 Temple Place, Suite 330 -% Boston, MA 02111-1307 USA +% 51 Franklin Street, Fifth Floor +% Boston, MA 02110-1301 USA \ProvidesPackage{mmd-envelope} diff --git a/texmf/tex/latex/mmd6/letterhead/mmd-letterhead.sty b/texmf/tex/latex/mmd6/letterhead/mmd-letterhead.sty index 889e7966..ec399ed4 100644 --- a/texmf/tex/latex/mmd6/letterhead/mmd-letterhead.sty +++ b/texmf/tex/latex/mmd6/letterhead/mmd-letterhead.sty @@ -23,8 +23,8 @@ % You should have received a copy of the GNU General Public License % along with this program; if not, write to the % Free Software Foundation, Inc. -% 59 Temple Place, Suite 330 -% Boston, MA 02111-1307 USA +% 51 Franklin Street, Fifth Floor +% Boston, MA 02110-1301 USA \ProvidesPackage{mmd-letterhead}