fix: single quotes can now be used to clear variables (fixes #450)

This commit is contained in:
evilsocket 2019-02-16 15:54:51 +01:00
parent 6980b864f5
commit 742e7fd8bb
No known key found for this signature in database
GPG key ID: 1564D7F30393A456
2 changed files with 3 additions and 2 deletions

View file

@ -223,7 +223,7 @@ func (s *Session) setHandler(args []string, sess *Session) error {
key := args[0]
value := args[1]
if value == "\"\"" {
if value == "\"\"" || value == "''" {
value = ""
}
@ -240,7 +240,7 @@ func (s *Session) readHandler(args []string, sess *Session) error {
value, _ := reader.ReadString('\n')
value = str.Trim(value)
if value == "\"\"" {
if value == "\"\"" || value == "''" {
value = ""
}

View file

@ -16,6 +16,7 @@ func ParseCommands(line string) []string {
finish := false
line = strings.Replace(line, `""`, `"<empty>"`, -1)
line = strings.Replace(line, `''`, `"<empty>"`, -1)
for _, c := range line {
switch c {
case ';':