fix-esc-seq.diff 4.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. diff --git a/tokenize.c b/tokenize.c
  2. index cb71c11..5662ef3 100644
  3. --- a/tokenize.c
  4. +++ b/tokenize.c
  5. @@ -1333,28 +1333,28 @@ int Tokenize( char *line, unsigned int start, struct asm_tok tokenarray[], unsig
  6. ;//OK QWORD
  7. else
  8. goto nobcst; /* let parser throw error */
  9. - if (*input1 != '\[') { /* if address is not inside [] */
  10. - *p1++ = '\['; /* force it */
  11. + if (*input1 != '[') { /* if address is not inside [] */
  12. + *p1++ = '['; /* force it */
  13. for (; *input1 > ','; p1++, input1++) { /* input1 points to [address] */
  14. if (*input1 == ';')
  15. break;
  16. *p1 = *input1; /* copy first memory part over 'qword bcst */
  17. }
  18. - *p1++ = '\]';
  19. + *p1++ = ']';
  20. if (*input1 == ';')
  21. *input1 = 0;
  22. while (isspace(*input1)) input1++; /* skip the space, now pointing to address */
  23. }
  24. else {
  25. - for (; *input1 != '\]'; p1++, input1++) /* input1 points to [address] */
  26. + for (; *input1 != ']'; p1++, input1++) /* input1 points to [address] */
  27. *p1 = *input1; /* copy first memory part over 'qword bcst */
  28. *p1++ = *input1++; /* copy ']' */
  29. }
  30. /* now add broadcast size */
  31. - if (cnt == 2) strcpy(p1, "\{1to2\}");
  32. - else if (cnt == 4) strcpy(p1, "\{1to4\}");
  33. - else if (cnt == 8) strcpy(p1, "\{1to8\}");
  34. - else if (cnt == 16) strcpy(p1, "\{1to16\}");
  35. + if (cnt == 2) strcpy(p1, "{1to2}");
  36. + else if (cnt == 4) strcpy(p1, "{1to4}");
  37. + else if (cnt == 8) strcpy(p1, "{1to8}");
  38. + else if (cnt == 16) strcpy(p1, "{1to16}");
  39. else goto nobcst; /* let parser throw error */
  40. strcat(p1, input1);
  41. }
  42. @@ -1364,24 +1364,24 @@ int Tokenize( char *line, unsigned int start, struct asm_tok tokenarray[], unsig
  43. if (*p1 == ';') { /* found ';' */
  44. *p1 = 0; /* that means '{' is in comment */
  45. }
  46. - if (*p1 == '\{') { /* found '{' */
  47. - if ((_memicmp(p1, "\{1to", 4) == 0))
  48. + if (*p1 == '{') { /* found '{' */
  49. + if ((_memicmp(p1, "{1to", 4) == 0))
  50. break; /* found "bcst" */
  51. } /* if it was {kn} or {z} search till end */
  52. }
  53. - if (*p1 == '\{') { /* if found {1toN} */
  54. + if (*p1 == '{') { /* if found {1toN} */
  55. p1--; /* go back 1 byte to check if ']' is present */
  56. while (isspace(*p1)) --p1; /* skip the space */
  57. - if (*p1 != '\]') { /* if not present insert it */
  58. + if (*p1 != ']') { /* if not present insert it */
  59. while (*p1 != ',') --p1; /* step backwards till the comma */
  60. p1++; /* skip the comma forward */
  61. input1 = p1; /* save that location in input1 */
  62. while (isspace(*p1)) p1++; /* skip the space */
  63. strcpy(buff, p1); /* copy to the buffer from variable on */
  64. - *input1++ = '\['; /* skip the space */
  65. - for (p1 = buff; *p1 != '\{'; p1++, input1++) /* till the end of var */
  66. + *input1++ = '['; /* skip the space */
  67. + for (p1 = buff; *p1 != '{'; p1++, input1++) /* till the end of var */
  68. *input1 = *p1; /* copy it back to input string */
  69. - *input1++ = '\]'; /* insert ']' before '{' */
  70. + *input1++ = ']'; /* insert ']' before '{' */
  71. strcpy(input1, p1); /* now copy the rest of string from buffer */
  72. }
  73. }