diff src/main/kotlin/name/blackcap/passman/Shplitter.kt @ 21:ea65ab890f66

More work to support interactive feature.
author David Barts <n5jrn@me.com>
date Tue, 02 Jul 2024 11:27:39 -0700
parents 4391afcf6bd0
children
line wrap: on
line diff
--- a/src/main/kotlin/name/blackcap/passman/Shplitter.kt	Sun Jun 30 22:28:52 2024 -0700
+++ b/src/main/kotlin/name/blackcap/passman/Shplitter.kt	Tue Jul 02 11:27:39 2024 -0700
@@ -108,22 +108,13 @@
             else -> { current.append(ch); false }
         }
 
+    // XXX - multiline commands achieved with backslash-newline
+    // sequences not supported, so this only works with single-
+    // line commands.
     private fun backslash(ch: Char): Boolean {
-        val last = lastState()
-        if (ch == '\n' && last !in QUOTING) {
-            // if not quoting, \\n makes a normal whitespace out of command terminator
-            popState()
-            return true
-        } else if (last == ::space) {
-            // start a new unquoted string no matter what
-            current.append(ch)
-            state = ::nonspace
-            return false
-        } else {
-            // continue existing string no matter what
-            current.append(ch)
-            popState()
-            return false
-        }
+        // continue existing string no matter what
+        current.append(ch)
+        popState()
+        return false
     }
 }