mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-24 04:00:07 +08:00
Use ISCNTRL in tui_copy_source_line
This changes tui_copy_source_line to use ISCNTRL. This lets it work more nicely with UTF-8 input. Note that this still won't work for stateful multi-byte encodings; for that much more work would be required. However, I think this patch does not make gdb any worse in this scenario. gdb/ChangeLog 2020-09-27 Tom Tromey <tom@tromey.com> PR tui/25342: * tui/tui-winsource.c (tui_copy_source_line): Use ISNCTRL.
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
2020-09-27 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
|
PR tui/25342:
|
||||||
|
* tui/tui-winsource.c (tui_copy_source_line): Use ISNCTRL.
|
||||||
|
|
||||||
2020-09-27 Tom Tromey <tom@tromey.com>
|
2020-09-27 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
* unittests/tui-selftests.c: Update.
|
* unittests/tui-selftests.c: Update.
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
#include "source.h"
|
#include "source.h"
|
||||||
#include "objfiles.h"
|
#include "objfiles.h"
|
||||||
#include "filenames.h"
|
#include "filenames.h"
|
||||||
|
#include "safe-ctype.h"
|
||||||
|
|
||||||
#include "tui/tui.h"
|
#include "tui/tui.h"
|
||||||
#include "tui/tui-data.h"
|
#include "tui/tui-data.h"
|
||||||
@ -107,7 +108,9 @@ tui_copy_source_line (const char **ptr, int *length)
|
|||||||
{
|
{
|
||||||
/* Nothing. */
|
/* Nothing. */
|
||||||
}
|
}
|
||||||
else if (c < 040 && c != '\t')
|
else if (c == '\t')
|
||||||
|
process_tab ();
|
||||||
|
else if (ISCNTRL (c))
|
||||||
{
|
{
|
||||||
result.push_back ('^');
|
result.push_back ('^');
|
||||||
result.push_back (c + 0100);
|
result.push_back (c + 0100);
|
||||||
@ -119,8 +122,6 @@ tui_copy_source_line (const char **ptr, int *length)
|
|||||||
result.push_back ('?');
|
result.push_back ('?');
|
||||||
++column;
|
++column;
|
||||||
}
|
}
|
||||||
else if (c == '\t')
|
|
||||||
process_tab ();
|
|
||||||
else
|
else
|
||||||
result.push_back (c);
|
result.push_back (c);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user