[libvirt] [PATCH] virsh: Convert escape sequence string to uppercase

Michal Privoznik mprivozn at redhat.com
Tue Dec 13 08:34:46 UTC 2011


Macro for translating escape sequence to char expects it to be
all uppercase. Without this, various lowercase sequences are
malformed: e.g. ^e gets translated to %.
---
 tools/virsh.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/tools/virsh.c b/tools/virsh.c
index d58b827..ff8b3d2 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -17776,6 +17776,11 @@ vshParseArgv(vshControl *ctl, int argc, char **argv)
             if ((len == 2 && *optarg == '^') ||
                 (len == 1 && *optarg != '^')) {
                 ctl->escapeChar = optarg;
+                while (*optarg) {
+                    if (islower(*optarg))
+                        *optarg = toupper(*optarg);
+                    optarg++;
+                }
             } else {
                 vshError(ctl, _("Invalid string '%s' for escape sequence"),
                          optarg);
-- 
1.7.3.4




More information about the libvir-list mailing list