Changeset: bc311a191c3b for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=bc311a191c3b
Modified Files:
        monetdb5/mal/mal_instruction.mx
Branch: default
Log Message:

Don't quote nil values


diffs (42 lines):

diff --git a/monetdb5/mal/mal_instruction.mx b/monetdb5/mal/mal_instruction.mx
--- a/monetdb5/mal/mal_instruction.mx
+++ b/monetdb5/mal/mal_instruction.mx
@@ -2502,12 +2502,18 @@
                                if ( !isVarConstant(mb, getArg(p,i)) && flg & 
LIST_MAL_ARG)
                                        snprintf(t,(len-(t-base)),"%s%s", 
(getVarTmp(mb,getArg(p,i))?"X":""), getArgName(mb, p, i));
                                advance(t,base,len);
-                               if( getTailType(getArgType(mb,p,i)) > TYPE_str 
&& !isVarUDFtype(mb, getArg(p, i)) )
+                               if( getTailType(getArgType(mb,p,i)) > TYPE_str )
                                {       char *ct;
                                        VALformat(&cv, &stk->stk[getArg(p, i)]);
                                        ct= (char*) GDKmalloc(1024+strlen(cv));
-                                       if (isVarUDFtype(mb, getArg(p, i)) )
-                                               snprintf(ct, 1024+strlen(cv), 
"\"%s\"", cv);
+                                       if (isVarUDFtype(mb, getArg(p, i)) ) {
+                                               if ( strcmp(cv,"nil") == 0)
+                                                       snprintf(ct, 
1024+strlen(cv), "%s", cv);
+                                               else
+                                                       snprintf(ct, 
1024+strlen(cv), "\"%s\"", cv);
+                                       } else
+                                       if ( strcmp(cv,"nil") == 0)
+                                               snprintf(ct, 1024+strlen(cv), 
"%s:%s", cv, getTypeName(getTailType(getArgType(mb,p,i))));
                                        else
                                                snprintf(ct, 1024+strlen(cv), 
"\"%s\":%s", cv, getTypeName(getTailType(getArgType(mb,p,i))));
                                        if( cv) GDKfree(cv);
@@ -2519,8 +2525,14 @@
                                { char *ct=cv;
                                        VALformat(&cv, &getVar(mb, getArg(p, 
i))->value);
                                        ct= (char*) GDKmalloc(1024+strlen(cv));
-                                       if (isVarUDFtype(mb, getArg(p, i)) )
-                                               snprintf(ct, 1024+strlen(cv), 
"\"%s\"", cv);
+                                       if (isVarUDFtype(mb, getArg(p, i)) ) {
+                                               if ( strcmp(cv,"nil") == 0)
+                                                       snprintf(ct, 
1024+strlen(cv), "%s", cv);
+                                               else
+                                                       snprintf(ct, 
1024+strlen(cv), "\"%s\"", cv);
+                                       } else
+                                       if ( strcmp(cv,"nil") == 0)
+                                               snprintf(ct, 1024+strlen(cv), 
"%s:%s", cv, getTypeName(getTailType(getArgType(mb,p,i))));
                                        else
                                                snprintf(ct, 1024+strlen(cv), 
"\"%s\":%s", cv, getTypeName(getTailType(getArgType(mb,p,i))));
                                        if( cv) GDKfree(cv);
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to