cosmetic and check for empty string in first_ucase
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@8413 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
0a29273061
commit
668a0f5719
1 changed files with 7 additions and 7 deletions
|
|
@ -221,14 +221,14 @@ String *Swig_string_ucase(String *s) {
|
||||||
* ----------------------------------------------------------------------------- */
|
* ----------------------------------------------------------------------------- */
|
||||||
|
|
||||||
String *Swig_string_first_ucase(String *s) {
|
String *Swig_string_first_ucase(String *s) {
|
||||||
String *ns = NewStringEmpty();
|
String *ns = NewStringEmpty();
|
||||||
char *cs = Char(s);
|
char *cs = Char(s);
|
||||||
if (cs) {
|
if (cs && cs[0] != 0) {
|
||||||
Putc(toupper(cs[0]),ns);
|
Putc(toupper(cs[0]),ns);
|
||||||
Append(ns, cs + 1);
|
Append(ns, cs + 1);
|
||||||
|
}
|
||||||
|
return ns;
|
||||||
}
|
}
|
||||||
return ns;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -----------------------------------------------------------------------------
|
/* -----------------------------------------------------------------------------
|
||||||
* Swig_string_typecode()
|
* Swig_string_typecode()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue