- for(string::size_type i = 0; i < keys.length(); ++i) {
- char * temp =
- keymap_[static_cast<unsigned char>(keys[i])] =
- new char[2];
- temp[0] = 0; temp[1] = accent;
+ for (string::size_type i = 0; i < keys.length(); ++i) {
+ string & temp =
+ keymap_[static_cast<unsigned char>(keys[i])];
+ if (!temp.empty())
+ temp.erase();
+
+ // But the question remains: "Should we be allowed
+ // to change bindings, without unbinding first?"
+ // Lgb
+ temp += char(0);
+ temp += char(accent);