Changeset: 4537d302a159 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4537d302a159
Modified Files:
        clients/mapiclient/mclient.c
        common/utils/conversion.c
        common/utils/conversion.h
Branch: protocol
Log Message:

Always print leading zero for timezone display.


diffs (56 lines):

diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -1047,7 +1047,7 @@ mapi_escape_name(char *name) {
        char *startbuffer = malloc(strlen(name) * 2 + 2);
        char *buffer = startbuffer;
        if (!startbuffer) return NULL;
-       if (strchr(name, ',') || strchr(name, '\t') || strchr(name, '#')) {
+       if (strchr(name, ',') || strchr(name, ' ') || strchr(name, '\t') || 
strchr(name, '#')) {
                *buffer++ = '"';
                char *p;
                for (p = name; *p; p++) {
diff --git a/common/utils/conversion.c b/common/utils/conversion.c
--- a/common/utils/conversion.c
+++ b/common/utils/conversion.c
@@ -320,7 +320,7 @@ conversion_time_optional_tz_to_string(ch
                diff_hour = timezone_diff / 3600000;
                timezone_diff -= diff_hour * 3600000;
                diff_min = timezone_diff / 60000;
-               if ((res = snprintf(dst + (9 + digits), len - (9 + digits), 
"%s%02d:%02d", original_diff >= 0 ? "+" : "", diff_hour, diff_min)) < 0) {
+               if ((res = snprintf(dst + (9 + digits), len - (9 + digits), 
"%s%02d:%02d", original_diff >= 0 ? "+" : "-", abs(diff_hour), diff_min)) < 0) {
                        return res;
                }
                return 15 + digits;
@@ -390,7 +390,7 @@ conversion_epoch_optional_tz_to_string(c
                diff_hour = timezone_diff / 3600000;
                timezone_diff -= diff_hour * 3600000;
                diff_min = timezone_diff / 60000;
-               if ((res = snprintf(dst + res, len - res, "%s%02d:%02d", 
original_diff >= 0 ? "+" : "", diff_hour, diff_min)) < 0) {
+               if ((res = snprintf(dst + res, len - res, "%s%02d:%02d", 
original_diff >= 0 ? "+" : "-", abs(diff_hour), diff_min)) < 0) {
                        return res;
                }
                return res;
diff --git a/common/utils/conversion.h b/common/utils/conversion.h
--- a/common/utils/conversion.h
+++ b/common/utils/conversion.h
@@ -66,7 +66,6 @@ void conversion_date_get_data(int date, 
 int conversion_time_to_string(char *dst, int len, const int *src, int 
null_value, int digits);
 int conversion_timetz_to_string(char *dst, int len, const int *src, int 
null_value, int digits, int timezone_diff);
 
-
 void conversion_time_get_data(int time, int timezone_diff, unsigned short 
*hour, unsigned short *minute, unsigned short *second, unsigned int 
*nanosecond);
 
 // timestamp conversion, *src is time since epoch in ms
@@ -75,11 +74,7 @@ int conversion_epoch_tz_to_string(char *
 
 void conversion_timestamp_get_data(lng timestamp, int timezone_diff, short 
*year, unsigned short *month, unsigned short *day, unsigned short *hour, 
unsigned short *minute, unsigned short *second, unsigned int *nanosecond);
 
-
 // blobs are converted to strings in hexadecimal format (i.e. two characters 
per byte)
 int conversion_blob_to_string(char *dst, int len, const char *blobdata, size_t 
nitems);
 
-
-
-
 #endif
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to