- Timestamp:
- Jan 30, 2011, 11:58:32 PM (14 years ago)
- Location:
- trunk/zoo-kernel
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-kernel/service_conf.l
r57 r100 41 41 42 42 attname [a-zA-Z0-9_\-]+ 43 attvalue1 [\ *\+,;@a-zA-Z0-9_\-::.:" "\"\'/\\\(\)]+43 attvalue1 [\^\*\+,;@a-zA-Z0-9_\-::.:" "\"\'/\\\(\)]+ 44 44 45 45 attvalue \"[^"]*\"|\'[^']*\'\(\) -
trunk/zoo-kernel/service_internal_python.c
r75 r100 305 305 for(i=0;i<nb;i++){ 306 306 PyObject* key=PyList_GetItem(list,i); 307 if(strcmp(PyString_AsString(key),"size")==0){308 PyObject* value=PyDict_GetItem((PyObject*)t,key);309 sizeValue=atoi(PyString_AsString(value));310 Py_DECREF(value);311 Py_DECREF(key);312 break;313 }314 Py_DECREF(key);315 }316 for(i=0;i<nb;i++){317 PyObject* key=PyList_GetItem(list,i);318 307 PyObject* value=PyDict_GetItem((PyObject*)t,key); 319 308 #ifdef DEBUG … … 321 310 PyString_AsString(key),PyString_AsString(value)); 322 311 #endif 323 if(s izeValue>=0 && strcmp(PyString_AsString(key),"value")==0){324 char *buffer=NULL; //(char*)malloc((sizeValue+1)*sizeof(char));312 if(strcmp(PyString_AsString(key),"value")==0){ 313 char *buffer=NULL; 325 314 Py_ssize_t size; 326 315 PyString_AsStringAndSize(value,&buffer,&size); 316 fprintf(stderr,"SIZE %d\n",size); 327 317 if(res!=NULL){ 328 318 addToMap(res,PyString_AsString(key),""); … … 332 322 map* tmpR=getMap(res,"value"); 333 323 free(tmpR->value); 334 tmpR->value=(char*)malloc((sizeValue+1)*sizeof(char)); 335 memmove(tmpR->value,buffer,sizeValue*sizeof(char)); 336 tmpR->value[sizeValue]=0; 324 tmpR->value=(char*)malloc((size+1)*sizeof(char)); 325 memmove(tmpR->value,buffer,size*sizeof(char)); 326 tmpR->value[size]=0; 327 char sin[1024]; 328 sprintf(sin,"%d",size); 329 addToMap(res,"size",sin); 337 330 }else{ 338 331 if(res!=NULL)
Note: See TracChangeset
for help on using the changeset viewer.