Skip to content

Commit

Permalink
Merge pull request #109 from yast/locale_independent_tolower
Browse files Browse the repository at this point in the history
Locale independent tolower
  • Loading branch information
jreidinger committed Apr 22, 2014
2 parents a8b8023 + f201b18 commit 465ea63
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
6 changes: 6 additions & 0 deletions package/yast2-ruby-bindings.changes
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Apr 22 09:31:18 UTC 2014 - jreidinger@suse.com

- Fix hang out of YaST2 in Turkish locale(bnc#852242)
- 3.1.16

-------------------------------------------------------------------
Fri Mar 14 15:33:30 UTC 2014 - mvidner@suse.com

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-ruby-bindings.spec
Expand Up @@ -17,7 +17,7 @@


Name: yast2-ruby-bindings
Version: 3.1.15
Version: 3.1.16
Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Source0: yast2-ruby-bindings-%{version}.tar.bz2
Expand Down
5 changes: 5 additions & 0 deletions src/binary/Y2RubyComponent.cc
Expand Up @@ -94,6 +94,9 @@ const string Y2RubyComponent::CamelCase2DelimSepated( const char* name)
size_t size = res.size();
if (size==0)
return res;
// convert always in C locale (bnc#852242)
char *old_locale = strdup(setlocale(LC_ALL, NULL));
setlocale(LC_ALL, "C");
res[0] = tolower(res[0]);
//first character and first char after :: is lowercase without underscore
for(size_t i = res.find("::"); i!= string::npos; i = res.find("::",i+1))
Expand All @@ -111,5 +114,7 @@ const string Y2RubyComponent::CamelCase2DelimSepated( const char* name)
res.replace(i,1,tmp); //replace upper by _lower
}
}
setlocale(LC_ALL, old_locale);
free(old_locale);
return res;
}

0 comments on commit 465ea63

Please sign in to comment.