Changeset 638 for trunk/thirds
- Timestamp:
- Apr 27, 2015, 3:28:16 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/thirds/saga2zcfg/saga2zcfg.c
r637 r638 15 15 } 16 16 17 const char* cleanAbstract(CSG_String abstract){17 void cleanAbstract(CSG_String abstract,char**res){ 18 18 char* tmp=strdup(abstract.b_str()); 19 CSG_String val=CSG_String(" 20 if(val.Contains(" ¸")){21 val.Replace(" ¸","");19 CSG_String val=CSG_String("")+tmp; 20 if(val.Contains("\r")){ 21 val.Replace("\r","<br/>"); 22 22 } 23 23 if(val.Contains("\n")){ 24 24 val.Replace("\n","<br/>"); 25 25 } 26 if(val.Contains("\r")){27 val.Replace("\r","");28 }29 26 if(val.Contains("<")){ 30 27 val.Replace("<","<"); … … 32 29 if(val.Contains(">")){ 33 30 val.Replace(">",">"); 34 fprintf(stderr,"%s\n",val.b_str());35 31 } 36 32 free(tmp); 37 fprintf(stderr,"%s\n",val.b_str()); 38 return val.b_str(); 33 if(val.is_Empty()) 34 *res=NULL; 35 else 36 *res=strdup(val.b_str()); 39 37 } 40 38 … … 45 43 fprintf(stdout," Abstract = %s\n",CSG_String(param->Get_Name()).b_str()); 46 44 else{ 47 fprintf(stdout," Abstract = %s\n",cleanAbstract(CSG_String(param->Get_Description()))); 45 char* tmp=strdup(CSG_String(param->Get_Description()).b_str()); 46 CSG_String val=CSG_String("")+tmp; 47 if(val.Contains("\r")){ 48 val.Replace("\r","<br/>"); 49 } 50 if(val.Contains("\n")){ 51 val.Replace("\n","<br/>"); 52 } 53 if(val.Contains("<")){ 54 val.Replace("<","<"); 55 } 56 if(val.Contains(">")){ 57 val.Replace(">",">"); 58 } 59 free(tmp); 60 fprintf(stdout," Abstract = %s\n",val.b_str()); 48 61 } 49 62 if(!out){ … … 148 161 149 162 mkdir(library->Get_Library_Name().b_str(),0755); 150 fprintf(stderr,"%s %s \n",library->Get_Library_Name().b_str(),CSG_String(module->Get_ID()).b_str()); 163 151 164 FILE *stdout1=fopen((library->Get_Library_Name()+"/"+module->Get_ID()+".zcfg").b_str(),"w+"); 152 165 fprintf(stdout1,"[%d]\n",j); … … 156 169 fprintf(stdout1," Abstract = %s\n",module->Get_Name().b_str()); 157 170 else{ 158 const char *tmp=cleanAbstract(module->Get_Description()); 159 if(tmp==NULL || strlen(tmp)<7 ){ 171 char *val0; 172 cleanAbstract(module->Get_Description(),&val0); 173 if(val0==NULL) 160 174 fprintf(stdout1," Abstract = %s\n",module->Get_Name().b_str()); 161 }162 175 else{ 163 fprintf(stdout1," Abstract = %s\n",tmp); 176 fprintf(stdout1," Abstract = %s\n",val0); 177 free(val0); 164 178 } 165 179 }
Note: See TracChangeset
for help on using the changeset viewer.