Browse Source

Merge pull request #655 from Rosuav/master

Two small changes
pull/656/merge
Damien George 11 years ago
parent
commit
9b967dd3cd
  1. 2
      py/objstr.c
  2. 2
      py/qstr.h

2
py/objstr.c

@ -68,7 +68,7 @@ void mp_str_print_quoted(void (*print)(void *env, const char *fmt, ...), void *e
// this escapes characters, but it will be very slow to print (calling print many times) // this escapes characters, but it will be very slow to print (calling print many times)
bool has_single_quote = false; bool has_single_quote = false;
bool has_double_quote = false; bool has_double_quote = false;
for (const byte *s = str_data, *top = str_data + str_len; (!has_single_quote || !has_double_quote) && s < top; s++) { for (const byte *s = str_data, *top = str_data + str_len; !has_double_quote && s < top; s++) {
if (*s == '\'') { if (*s == '\'') {
has_single_quote = true; has_single_quote = true;
} else if (*s == '"') { } else if (*s == '"') {

2
py/qstr.h

@ -24,7 +24,7 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
// See qstrraw.h for a list of qstr's that are available as constants. // See qstrdefs.h for a list of qstr's that are available as constants.
// Reference them as MP_QSTR_xxxx. // Reference them as MP_QSTR_xxxx.
// //
// Note: it would be possible to define MP_QSTR_xxx as qstr_from_str_static("xxx") // Note: it would be possible to define MP_QSTR_xxx as qstr_from_str_static("xxx")

Loading…
Cancel
Save