From b0d081ad044f209d2d71b0572a20f491bdda55b9 Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Mon, 13 May 2019 21:27:59 -0600 Subject: [PATCH 1/2] Fix to read direct / full path & 'readSauce' option of art --- core/art.js | 2 +- core/theme.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/art.js b/core/art.js index d709d366..19fa41e8 100644 --- a/core/art.js +++ b/core/art.js @@ -144,7 +144,7 @@ function getArt(name, options, cb) { // If an extension is provided, just read the file now if('' !== ext) { - const directPath = paths.join(options.basePath, name); + const directPath = paths.isAbsolute(name) ? name : paths.join(options.basePath, name); return getArtFromPath(directPath, options, cb); } diff --git a/core/theme.js b/core/theme.js index 9978fde3..8460cf24 100644 --- a/core/theme.js +++ b/core/theme.js @@ -439,7 +439,7 @@ function getThemeArt(options, cb) { // :TODO: replace asAnsi stuff with something like retrieveAs = 'ansi' | 'pipe' | ... // :TODO: Some of these options should only be set if not provided! options.asAnsi = true; // always convert to ANSI - options.readSauce = true; // read SAUCE, if avail + options.readSauce = _.get(options, 'readSauce', true); // read SAUCE, if avail options.random = _.get(options, 'random', true); // FILENAME.EXT support // From 228d3e3ae788ae9c6a80458c0092d203bb3fda39 Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Mon, 13 May 2019 21:31:34 -0600 Subject: [PATCH 2/2] Improve legacy EOF detector: Must be at least >= size of SAUCE --- core/art.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/art.js b/core/art.js index 19fa41e8..38594985 100644 --- a/core/art.js +++ b/core/art.js @@ -57,6 +57,9 @@ function sliceAtEOF(data, eofMarker) { break; } } + if(eof === data.length || eof < 128) { + return data; + } return data.slice(0, eof); }