The patch number 8170 was added via Hans Verkuil <[EMAIL PROTECTED]>
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
        [EMAIL PROTECTED]

------

From: Hans Verkuil  <[EMAIL PROTECTED]>
v4l2-ctl: improve handling of control names with non-alnum chars


Signed-off-by: Hans Verkuil <[EMAIL PROTECTED]>


---

 v4l2-apps/util/v4l2-ctl.cpp |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff -r 0dc6f568e2a0 -r 75053baa7b48 v4l2-apps/util/v4l2-ctl.cpp
--- a/v4l2-apps/util/v4l2-ctl.cpp       Sat Jun 28 22:57:56 2008 +0200
+++ b/v4l2-apps/util/v4l2-ctl.cpp       Sun Jun 29 11:27:34 2008 +0200
@@ -485,10 +485,16 @@ static std::string name2var(unsigned cha
 static std::string name2var(unsigned char *name)
 {
        std::string s;
+       int add_underscore = 0;
 
        while (*name) {
-               if (*name == ' ') s += "_";
-               else s += std::string(1, tolower(*name));
+               if (isalnum(*name)) {
+                       if (add_underscore)
+                               s += '_';
+                       add_underscore = 0;
+                       s += std::string(1, tolower(*name));
+               }
+               else if (s.length()) add_underscore = 1;
                name++;
        }
        return s;


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/75053baa7b48bdff0d76826717bd8ecd010af150

_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to