diff options
author | Roderick W. Smith <rodsmith@rodsbooks.com> | 2014-02-17 16:17:11 -0500 |
---|---|---|
committer | Roderick W. Smith <rodsmith@rodsbooks.com> | 2014-02-17 16:17:11 -0500 |
commit | 84aaff6b9cf3b802c621781cf9acd006aa5a3e66 (patch) | |
tree | 9f46bf77212466e4e66a2163ab86a8be39b62508 /gptcurses.cc | |
parent | 22e88b5be2c0c3f92e34d95da45922abfa02a28d (diff) | |
download | sgdisk-84aaff6b9cf3b802c621781cf9acd006aa5a3e66.tar.gz |
Removed libicu dependency for UTF-16 partition names. Version 0.8.9
release.
Diffstat (limited to 'gptcurses.cc')
-rw-r--r-- | gptcurses.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/gptcurses.cc b/gptcurses.cc index 2ec8a40..6002077 100644 --- a/gptcurses.cc +++ b/gptcurses.cc @@ -39,6 +39,7 @@ GPTDataCurses::GPTDataCurses(void) { if (numInstances > 0) { refresh(); } else { + setlocale( LC_ALL , "" ); initscr(); cbreak(); noecho(); @@ -318,7 +319,7 @@ void GPTDataCurses::DeletePartition(int partNum) { void GPTDataCurses::ShowInfo(int partNum) { uint64_t size; #ifdef USE_UTF16 - char temp[NAME_SIZE / 2 + 1]; + char temp[NAME_SIZE + 1]; #endif clear(); @@ -335,7 +336,7 @@ void GPTDataCurses::ShowInfo(int partNum) { printw("Partition size: %lld sectors (%s)\n", size, BytesToIeee(size, blockSize).c_str()); printw("Attribute flags: %016x\n", partitions[partNum].GetAttributes().GetAttributes()); #ifdef USE_UTF16 - partitions[partNum].GetDescription().extract(0, NAME_SIZE / 2, temp, NAME_SIZE / 2); + partitions[partNum].GetDescription().extract(0, NAME_SIZE , temp, NAME_SIZE ); printw("Partition name: '%s'\n", temp); #else printw("Partition name: '%s'\n", partitions[partNum].GetDescription().c_str()); @@ -345,21 +346,21 @@ void GPTDataCurses::ShowInfo(int partNum) { // Prompt for and change a partition's name.... void GPTDataCurses::ChangeName(int partNum) { - char temp[NAME_SIZE / 2 + 1]; + char temp[NAME_SIZE + 1]; if (ValidPartNum(partNum)) { move(LINES - 4, 0); clrtobot(); move(LINES - 4, 0); #ifdef USE_UTF16 - partitions[partNum].GetDescription().extract(0, NAME_SIZE / 2, temp, NAME_SIZE / 2); + partitions[partNum].GetDescription().extract(0, NAME_SIZE , temp, NAME_SIZE ); printw("Current partition name is '%s'\n", temp); #else printw("Current partition name is '%s'\n", partitions[partNum].GetDescription().c_str()); #endif printw("Enter new partition name, or <Enter> to use the current name:\n"); echo(); - getnstr(temp, NAME_SIZE / 2); + getnstr(temp, NAME_SIZE ); partitions[partNum].SetName((string) temp); noecho(); } // if |