Changeset: 62929b9c791b for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=62929b9c791b
Modified Files:
        clients/ChangeLog
        clients/src/mapiclient/mclient.c
Branch: default
Log Message:

lowercase pattern given to \d command, unless quoted by either single or double 
quotes


diffs (46 lines):

diff -r 1f5f01f8bdfd -r 62929b9c791b clients/ChangeLog
--- a/clients/ChangeLog Fri Nov 19 13:58:27 2010 +0100
+++ b/clients/ChangeLog Fri Nov 19 14:42:04 2010 +0100
@@ -2,5 +2,7 @@
 # This file is updated with Maddlog
 
 * Fri Nov 19 2010 Fabian Groffen <[email protected]>
+- object names given to \d are now lowercased, unless quoted by either
+  single or double quotes
 - Strip any trailing whitespace with the \d command
 
diff -r 1f5f01f8bdfd -r 62929b9c791b clients/src/mapiclient/mclient.c
--- a/clients/src/mapiclient/mclient.c  Fri Nov 19 13:58:27 2010 +0100
+++ b/clients/src/mapiclient/mclient.c  Fri Nov 19 14:42:04 2010 +0100
@@ -1973,6 +1973,31 @@
                                        for (p-- ; p >= line && isascii((int) 
*p) && isspace((int) *p); p--)
                                                *p = '\0';
 
+                                       /* is the object quoted? we only 
support fully
+                                        * quoted objects, not partial ones */
+                                       if (line[0] == '"' || line[0] == '\'') {
+                                               for (p = line; *p; p++)
+                                                       ;
+                                               if (--p == line) {
+                                                       fprintf(stderr, 
"unmatched %c\n", line[0]);
+                                                       continue;
+                                               } else if ((*p == '"' || *p == 
'\'') && *p != line[0]) {
+                                                       fprintf(stderr, 
"unexpected %c, expecting %c\n",
+                                                                       *p, 
line[0]);
+                                                       continue;
+                                               } else if (*p != line[0]) {
+                                                       fprintf(stderr, 
"unexpected end of string while "
+                                                                       
"looking for matching %c\n", line[0]);
+                                                       continue;
+                                               }
+                                               /* remove the quotes */
+                                               line++;
+                                               *p = '\0';
+                                       } else {
+                                               /* no, lowercase it */
+                                               for (p = line; *p; p++)
+                                                       *p = tolower((int) *p);
+                                       }
                                        if (*line) {
 #ifdef HAVE_POPEN
                                                stream *saveFD, *saveFD_raw;
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to