Changeset 337 for branches/samba-3.0/source/lib/iconv.c
- Timestamp:
- Oct 8, 2009, 8:01:00 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.0/source/lib/iconv.c
r165 r337 129 129 } 130 130 131 #ifdef __OS2__ 132 // i could have done a static variable w/o this function. but i feel it's nicer this way. SCS 133 // the purpose of this function is to save the to_name to get the korean and japanese code set working 134 char * save_toname(char *toname, bool what) 135 { 136 static char *to_name=NULL; 137 138 if ( what == 0 ) 139 to_name = SMB_STRDUP(toname); 140 141 return to_name; 142 } 143 #endif 144 131 145 #ifdef HAVE_NATIVE_ICONV 132 146 /* if there was an error then reset the internal state, … … 139 153 #ifdef __OS2__ 140 154 uint16 *outbuf_uc = ( uint16 * )*outbuf; 155 char *to_name = save_toname(NULL, 1); 141 156 #endif 142 157 … … 153 168 else 154 169 { 170 if( (strstr(to_name, "949") != NULL) || /* Korean CP */ 171 (strstr(to_name, "932") != NULL) || /* Japanese CP */ 172 (strstr(to_name, "942") != NULL) || /* Japanese CP */ 173 (strstr(to_name, "943") != NULL) ) /* Japanese CP */ 174 { 155 175 while(( char * )outbuf_uc < *outbuf ) 156 176 { … … 160 180 161 181 outbuf_uc++; 182 } 162 183 } 163 184 } … … 181 202 size_t bufsize; 182 203 204 #ifdef __OS2__ 205 save_toname(cd->to_name, 0); 206 #endif 207 183 208 /* in many cases we can go direct */ 184 209 if (cd->direct) { … … 195 220 if (cd->pull(cd->cd_pull, 196 221 inbuf, inbytesleft, &bufp, &bufsize) == -1 197 && errno != E2BIG) { 198 DEBUG(0,("smb_iconv 2\n")); 199 return -1;} 222 && errno != E2BIG) 223 return -1; 200 224 201 225 bufp = cvtbuf; … … 204 228 if (cd->push(cd->cd_push, 205 229 (const char **)&bufp, &bufsize, 206 outbuf, outbytesleft) == -1) { 207 DEBUG(0,("smb_iconv 3\n")); 208 return -1;} 230 outbuf, outbytesleft) == -1) 231 return -1; 209 232 } 210 233
Note:
See TracChangeset
for help on using the changeset viewer.