reactos/lib/sdk/crt/mbstring/mbsrev.c
Amine Khaldi 527f2f9057 [SHELL/EXPERIMENTS]
* Create a branch for some evul shell experiments.

svn path=/branches/shell-experiments/; revision=61927
2014-02-02 19:37:27 +00:00

33 lines
359 B
C

#include <mbstring.h>
/*
* @implemented
*/
unsigned char * _mbsrev(unsigned char *s)
{
unsigned char *e;
unsigned char a;
unsigned char *e2;
e=s;
while (*e) {
if ( _ismbblead(*e) ) {
a = *e;
e2 = e;
*e2 = *++e;
if ( *e == 0 )
break;
*e = a;
}
e++;
}
while (s<e) {
a=*s;
*s=*e;
*e=a;
s++;
e--;
}
return s;
}