diff options
author | Seth Alves <alves@src.gnome.org> | 2000-02-21 21:19:28 +0800 |
---|---|---|
committer | Seth Alves <alves@src.gnome.org> | 2000-02-21 21:19:28 +0800 |
commit | c2e1263462c84bfae59a3f296758296ac3a10a67 (patch) | |
tree | 56965c52067222cac0199e2a09d33ef93b0dcb4d /libical/src | |
parent | c69d6adfcd4b6ef04cae78c87f2328b8debb13bb (diff) | |
download | gsoc2013-evolution-c2e1263462c84bfae59a3f296758296ac3a10a67.tar gsoc2013-evolution-c2e1263462c84bfae59a3f296758296ac3a10a67.tar.gz gsoc2013-evolution-c2e1263462c84bfae59a3f296758296ac3a10a67.tar.bz2 gsoc2013-evolution-c2e1263462c84bfae59a3f296758296ac3a10a67.tar.lz gsoc2013-evolution-c2e1263462c84bfae59a3f296758296ac3a10a67.tar.xz gsoc2013-evolution-c2e1263462c84bfae59a3f296758296ac3a10a67.tar.zst gsoc2013-evolution-c2e1263462c84bfae59a3f296758296ac3a10a67.zip |
This commit was generated by cvs2svn to compensate for changes in r1879,
which included commits to RCS files with non-trunk default branches.
svn path=/trunk/; revision=1880
Diffstat (limited to 'libical/src')
-rw-r--r-- | libical/src/libical/ical.h | 2 | ||||
-rw-r--r-- | libical/src/libical/icalitip.y | 4 | ||||
-rw-r--r-- | libical/src/libical/icalparameter.c | 4 | ||||
-rw-r--r-- | libical/src/libical/icalproperty.c | 1 | ||||
-rw-r--r-- | libical/src/libical/icalvalue.c | 60 | ||||
-rw-r--r-- | libical/src/libicalss/icalcluster.c | 1 | ||||
-rw-r--r-- | libical/src/libicalss/icalstore.c | 6 | ||||
-rw-r--r-- | libical/src/test/regression.c | 40 |
8 files changed, 104 insertions, 14 deletions
diff --git a/libical/src/libical/ical.h b/libical/src/libical/ical.h index a90bb551ed..cd5ca31dd5 100644 --- a/libical/src/libical/ical.h +++ b/libical/src/libical/ical.h @@ -34,6 +34,8 @@ #include "icalparser.h" #include "icalmemory.h" #include "icalerror.h" +#include "icalrestriction.h" + #endif /* !ICAL_H */ diff --git a/libical/src/libical/icalitip.y b/libical/src/libical/icalitip.y index 7415fe2676..8e4f16b553 100644 --- a/libical/src/libical/icalitip.y +++ b/libical/src/libical/icalitip.y @@ -6,7 +6,7 @@ DESCRIPTION: - $Id: icalitip.y,v 1.1 2000/02/17 18:02:27 alves Exp $ + $Id: icalitip.y,v 1.1.1.2 2000/02/21 13:19:26 alves Exp $ $Locker: $ (C) COPYRIGHT 1999 Eric Busboom @@ -393,7 +393,7 @@ utcoffset_value: void clear_recur() -{ +{ memset(&skiplist, ICAL_RECURRENCE_ARRAY_MAX_BYTE, sizeof(skiplist)); skippos = 0; diff --git a/libical/src/libical/icalparameter.c b/libical/src/libical/icalparameter.c index ab984722d5..ff9c76f79c 100644 --- a/libical/src/libical/icalparameter.c +++ b/libical/src/libical/icalparameter.c @@ -756,6 +756,9 @@ icalparameter_as_ical_string (icalparameter* parameter) case ICAL_VALUE_TIME: { strcpy(tend,"TIME");break; } + case ICAL_VALUE_URI: { + strcpy(tend,"URI");break; + } case ICAL_VALUE_UTCOFFSET: { strcpy(tend,"UTC-OFFSET");break; } @@ -764,6 +767,7 @@ icalparameter_as_ical_string (icalparameter* parameter) strcpy(tend,impl->string);break; } default:{ + strcpy(tend,"ERROR");break; icalerror_set_errno(ICAL_BADARG_ERROR);break; } } diff --git a/libical/src/libical/icalproperty.c b/libical/src/libical/icalproperty.c index 7eb7c81111..3dd761b1f8 100644 --- a/libical/src/libical/icalproperty.c +++ b/libical/src/libical/icalproperty.c @@ -1,4 +1,5 @@ /* -*- Mode: C -*- */ + /*====================================================================== FILE: icalproperty.c CREATOR: eric 28 April 1999 diff --git a/libical/src/libical/icalvalue.c b/libical/src/libical/icalvalue.c index 81352dd247..1ed83a0c6e 100644 --- a/libical/src/libical/icalvalue.c +++ b/libical/src/libical/icalvalue.c @@ -1777,18 +1777,74 @@ void icalvalue_set_text(icalvalue* value, char* v) { struct icalvalue_impl* impl; - + char *p,*d; + icalerror_check_arg_rv( (value!=0),"value"); icalerror_check_arg_rv( (v!=0),"v"); icalerror_check_value_type(value, ICAL_TEXT_VALUE); impl = (struct icalvalue_impl*)value; - impl->data.v_string = strdup(v); + impl->data.v_string = malloc(strlen(v)+1); if (impl->data.v_string == 0){ errno = ENOMEM; + return; + } + + for(d=impl->data.v_string,p=v; *p!=0; p++){ + + if (*p == '\\') { + p++; + + if (p == 0){ + break; + } + + switch(*p){ + case 'n': { + *d='\n';d++; + break; + } + + case '\\': { + *d='\\';d++; + break; + } + + case 't': { + *d='\n';d++; + break; + } + case 'r': { + *d='\r';d++; + break; + } + case 'b': { + *d='\b';d++; + break; + } + case 'f': { + *d='\f';d++; + break; + } + + case ';': + case ',':{ + *d=*p;d++; + break; + } + + case '"':{ + *d='\"';d++; + break; + } + } + } else { + *d=*p;d++; + } } + *d='\0'; } diff --git a/libical/src/libicalss/icalcluster.c b/libical/src/libicalss/icalcluster.c index 00e7ef0365..c0160cc6c3 100644 --- a/libical/src/libicalss/icalcluster.c +++ b/libical/src/libicalss/icalcluster.c @@ -67,7 +67,6 @@ icalerrorenum icalcluster_create_cluster(char *path) f = fopen(path,"w"); if (f == 0){ - fclose(f); icalerror_set_errno(ICAL_FILE_ERROR); return ICAL_FILE_ERROR; } diff --git a/libical/src/libicalss/icalstore.c b/libical/src/libicalss/icalstore.c index 014c9ed19b..5d1546f3b2 100644 --- a/libical/src/libicalss/icalstore.c +++ b/libical/src/libicalss/icalstore.c @@ -206,11 +206,13 @@ void icalstore_free(icalstore* s) icalcluster_free(impl->cluster); } - while( (str=pvl_pop(impl->directory)) != 0){ + while(impl->directory !=0 && (str=pvl_pop(impl->directory)) != 0){ free(str); } - pvl_free(impl->directory); + if(impl->directory != 0){ + pvl_free(impl->directory); + } impl->directory = 0; impl->directory_iterator = 0; diff --git a/libical/src/test/regression.c b/libical/src/test/regression.c index 822de6b22c..a969022d98 100644 --- a/libical/src/test/regression.c +++ b/libical/src/test/regression.c @@ -1237,15 +1237,38 @@ void test_duration() printf("%s\n",icalvalue_as_ical_string(v)); + icalvalue_free(v); v = icalvalue_new_from_string(ICAL_PERIOD_VALUE, "19971015T050000Z/PT8H30M"); printf("%s\n",icalvalue_as_ical_string(v)); + icalvalue_free(v); v = icalvalue_new_from_string(ICAL_PERIOD_VALUE, "19971015T050000Z/19971015T060000Z"); printf("%s\n",icalvalue_as_ical_string(v)); + icalvalue_free(v); + + +} + + +void test_strings(){ + + icalvalue *v; + + v = icalvalue_new_text("foo;bar;bats"); + + printf("%s\n",icalvalue_as_ical_string(v)); + + icalvalue_free(v); + + v = icalvalue_new_text("foo\\;b\nar\\;ba\tts"); + + printf("%s\n",icalvalue_as_ical_string(v)); + + icalvalue_free(v); } @@ -1253,25 +1276,28 @@ void test_duration() int main(int argc, char *argv[]) { + + printf("\n------------Test strings---------------\n"); + test_strings(); + +exit(0); + + printf("\n------------Test recur---------------\n"); + test_recur(); + #if 0 printf("\n------------Test Calendar---------------\n"); test_calendar(); printf("\n------------Test Store---------------\n"); test_store(); +#endif printf("\n------------Test duration---------------\n"); test_duration(); -#endif - - printf("\n------------Test recur---------------\n"); - test_recur(); - -exit(0); - printf("\n------------Test Restriction---------------\n"); test_restriction(); |