because uni_str is incremented in utf8_to_u_hostendian() UNICODE is moved inside the loop in _utf8_to_sjis_bendian() to avoid crashing. (it points to a single unicode char!!) (other option is to not increment uni_str, but it's kept for consistency).

some cosmetic changes


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10575 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
François Revol
2005-01-03 22:37:46 +00:00
parent 92044c244d
commit 11ad2d6866
3 changed files with 11 additions and 10 deletions
@@ -1054,13 +1054,13 @@ _utf8_to_sjis_bendian(
int32 dstLimit = *dstLen; int32 dstLimit = *dstLen;
int32 srcCount = 0; int32 srcCount = 0;
int32 dstCount = 0; int32 dstCount = 0;
uint16 unicode;
uint16 *UNICODE = &unicode;
while ((srcCount < srcLimit) && (dstCount < dstLimit)) { while ((srcCount < srcLimit) && (dstCount < dstLimit)) {
if ((srcCount + utf8_char_len(src[srcCount])) > srcLimit) if ((srcCount + utf8_char_len(src[srcCount])) > srcLimit)
break; break;
uint16 unicode;
uint16 *UNICODE = &unicode;
int err_flag; int err_flag;
bool multibyte = false; bool multibyte = false;
const uint16 *table = NULL; const uint16 *table = NULL;
@@ -1209,6 +1209,7 @@ int dosfs_rename(void *_vol, void *_odir, const char *oldname,
#endif #endif
notify_listener(B_ENTRY_MOVED, vol->id, odir->vnid, ndir->vnid, file->vnid, newname); notify_listener(B_ENTRY_MOVED, vol->id, odir->vnid, ndir->vnid, file->vnid, newname);
// update MIME information // update MIME information
if(!(file->mode & FAT_SUBDIR)) { if(!(file->mode & FAT_SUBDIR)) {
set_mime_type(file, newname); set_mime_type(file, newname);