History

Fix get_tok_str wrt wide characters

Fixes both, character constants and string literals.

Daniel Glöckner committed 17 years ago

Commit 5fd6f7b1 parent deb41071 file · +4 −2Browse files

Unified · Split

tcc.c+4−2
@@ -1770,8 +1770,9 @@ char *get_tok_str(int v, CValue *cv) · 1769 unmodified lines
1770 /* XXX: not quite exact, but only useful for testing */1770 /* XXX: not quite exact, but only useful for testing */
1771 sprintf(p, "%Lu", cv->ull);1771 sprintf(p, "%Lu", cv->ull);
1772 break;1772 break;
1773 case TOK_CCHAR:
1774 case TOK_LCHAR:1773 case TOK_LCHAR:
1774 cstr_ccat(&cstr_buf, 'L');
1775 case TOK_CCHAR:
1775 cstr_ccat(&cstr_buf, '\'');1776 cstr_ccat(&cstr_buf, '\'');
1776 add_char(&cstr_buf, cv->i);1777 add_char(&cstr_buf, cv->i);
1777 cstr_ccat(&cstr_buf, '\'');1778 cstr_ccat(&cstr_buf, '\'');
@@ -1784,8 +1785,9 @@ char *get_tok_str(int v, CValue *cv) · 6 unmodified lines
1784 add_char(&cstr_buf, ((unsigned char *)cstr->data)[i]);1785 add_char(&cstr_buf, ((unsigned char *)cstr->data)[i]);
1785 cstr_ccat(&cstr_buf, '\0');1786 cstr_ccat(&cstr_buf, '\0');
1786 break;1787 break;
1787 case TOK_STR:
1788 case TOK_LSTR:1788 case TOK_LSTR:
1789 cstr_ccat(&cstr_buf, 'L');
1790 case TOK_STR:
1789 cstr = cv->cstr;1791 cstr = cv->cstr;
1790 cstr_ccat(&cstr_buf, '\"');1792 cstr_ccat(&cstr_buf, '\"');
1791 if (v == TOK_STR) {1793 if (v == TOK_STR) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t