From: Niki Roo Date: Tue, 10 Apr 2018 08:08:34 +0000 (+0200) Subject: justify tool: accepts \r\n text X-Git-Tag: nikiroo-utils-4.4.0~17 X-Git-Url: https://git.nikiroo.be/?a=commitdiff_plain;h=67e9a06e496d2c11432e4356c71e0af5a9204b16;p=nikiroo-utils.git justify tool: accepts \r\n text --- diff --git a/src/be/nikiroo/utils/main/justify.java b/src/be/nikiroo/utils/main/justify.java index cf58905..32cfb10 100644 --- a/src/be/nikiroo/utils/main/justify.java +++ b/src/be/nikiroo/utils/main/justify.java @@ -38,7 +38,7 @@ public class justify { // TODO: move to utils? List lines = new ArrayList(); Scanner scan = new Scanner(System.in); - scan.useDelimiter("[\r\n]"); + scan.useDelimiter("\r\n|[\r\n]"); try { StringBuilder previous = null; StringBuilder tmp = new StringBuilder(); @@ -90,6 +90,7 @@ public class justify { return line.length() == 0 // || line.charAt(line.length() - 1) == '.' || line.charAt(line.length() - 1) == '"' - || line.charAt(line.length() - 1) == '»'; + || line.charAt(line.length() - 1) == '»' + ; } }