changeset 337:3a25be278864

Values can be enclosed by quotes in assignments Thus, passwords with leading/trailing spaces can be typed. Examples: set password = " with spaces " set password = "with "quotes""
author Mikael Berthe <mikael@lilotux.net>
date Mon, 18 Jul 2005 21:47:05 +0100
parents eb994ee40029
children 7bd4ffee9497
files mcabber/src/settings.c
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mcabber/src/settings.c	Mon Jul 18 21:27:08 2005 +0100
+++ b/mcabber/src/settings.c	Mon Jul 18 21:47:05 2005 +0100
@@ -119,6 +119,12 @@
 
   if (t < val) return TRUE; // no value (variable reset for example)
 
+  // If the value begins and ends with quotes ("), these quotes are
+  // removed and whitespace is not stripped
+  if ((t>val) && (*val == '"' && *t == '"')) {
+    val++;
+    t--;
+  }
   *pval = g_strndup(val, t+1-val);
   return TRUE;
 }