From 57fbd0c898775d6b45d1967f368d4fcd88e2c6ae Mon Sep 17 00:00:00 2001 From: TudbuT Date: Mon, 16 May 2022 00:46:05 +0200 Subject: [PATCH] improve string blocks, improve patch detection --- ISBPL.java | 8 ++++++-- setup.sh | 7 ++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ISBPL.java b/ISBPL.java index 75eb686..cf8a532 100644 --- a/ISBPL.java +++ b/ISBPL.java @@ -257,8 +257,12 @@ public class ISBPL { idx++; AtomicInteger i = new AtomicInteger(idx); String s = ""; - for(String w : readBlock(i, words, file)) - s += w + " "; + for(String w : readBlock(i, words, file)) { + s += w; + if(w.length() > 0 && w.charAt(0) == '"') + s += '"'; + s += " "; + } s = s.substring(0, s.length() - 1); stack.push(toISBPLString(s)); return i.get(); diff --git a/setup.sh b/setup.sh index 221bb06..4bae36b 100644 --- a/setup.sh +++ b/setup.sh @@ -2,6 +2,7 @@ if [ "$ISBPL_PATH" = "" ] ; then echo 'ISBPL_PATH=/usr/lib/isbpl' >> /etc/environment fi +IFS=: read -r BIN OTHERBIN <<< "$PATH" mkdir /usr/lib/isbpl >& /dev/null cp ./*.isbpl /usr/lib/isbpl >& /dev/null cd bootstrap @@ -12,8 +13,8 @@ rm ISBPL.java ISBPL.jar zip -r ISBPL.jar * META-INF rm *.class cd .. -echo "#!/usr/bin/java -jar" > ISBPL.jar +echo "#!${BIN}/java -jar" > ISBPL.jar cat bootstrap/ISBPL.jar >> ISBPL.jar chmod a+rx ISBPL.jar -cp ISBPL.jar /bin/isbpl -chmod a+rx /bin/isbpl +cp ISBPL.jar "${BIN}/isbpl" +chmod a+rx "${BIN}/isbpl"