- char* e;
- STRLEN numbers_len;
- I32 flags = PERL_SCAN_DISALLOW_PREFIX;
-
- PERL_ARGS_ASSERT_GROK_BSLASH_X;
-
- PERL_UNUSED_ARG(output_warning);
-
- assert(**s == 'x');
- (*s)++;
-
- if (strict) {
- flags |= PERL_SCAN_SILENT_ILLDIGIT;
- }
-
- if (**s != '{') {
- STRLEN len = (strict) ? 3 : 2;
-
- *uv = grok_hex(*s, &len, &flags, NULL);
- *s += len;
- if (strict && len != 2) {
- if (len < 2) {
- *s += (UTF) ? UTF8SKIP(*s) : 1;
- *error_msg = "Non-hex character";
- }
- else {
- *error_msg = "Use \\x{...} for more than two hex characters";
- }
- return FALSE;
- }
- return TRUE;
- }
-
- e = strchr(*s, '}');
- if (!e) {
- (*s)++; /* Move past the '{' */
- while (isXDIGIT(**s)) { /* Position beyond the legal digits */
- (*s)++;
- }
- /* XXX The corresponding message above for \o is just '\\o{'; other
- * messages for other constructs include the '}', so are inconsistent.
- */
- *error_msg = "Missing right brace on \\x{}";
- return FALSE;
- }
-
- (*s)++; /* Point to expected first digit (could be first byte of utf8
- sequence if not a digit) */
- numbers_len = e - *s;
- if (numbers_len == 0) {
- if (strict) {
- (*s)++; /* Move past the } */
- *error_msg = "Number with no digits";
- return FALSE;
- }
- return TRUE;
- }
-
- flags |= PERL_SCAN_ALLOW_UNDERSCORES;
- if (silence_non_portable) {
- flags |= PERL_SCAN_SILENT_NON_PORTABLE;
- }
-
- *uv = grok_hex(*s, &numbers_len, &flags, NULL);
- /* Note that if has non-hex, will ignore everything starting with that up
- * to the '}' */
-
- if (strict && numbers_len != (STRLEN) (e - *s)) {
- *s += numbers_len;
- *s += (UTF) ? UTF8SKIP(*s) : 1;
- *error_msg = "Non-hex character";
- return FALSE;
- }
-
- /* Return past the '}' */
- *s = e + 1;
-
- return TRUE;
+ char* e;
+ STRLEN numbers_len;
+ I32 flags = PERL_SCAN_DISALLOW_PREFIX;
+
+ PERL_ARGS_ASSERT_GROK_BSLASH_X;
+
+ PERL_UNUSED_ARG(output_warning);
+
+ assert(**s == 'x');
+ (*s)++;
+
+ if (strict) {
+ flags |= PERL_SCAN_SILENT_ILLDIGIT;
+ }
+
+ if (**s != '{') {
+ STRLEN len = (strict) ? 3 : 2;
+
+ *uv = grok_hex(*s, &len, &flags, NULL);
+ *s += len;
+ if (strict && len != 2) {
+ if (len < 2) {
+ *s += (UTF) ? UTF8SKIP(*s) : 1;
+ *error_msg = "Non-hex character";
+ }
+ else {
+ *error_msg = "Use \\x{...} for more than two hex characters";
+ }
+ return FALSE;
+ }
+ return TRUE;
+ }
+
+ e = strchr(*s, '}');
+ if (!e) {
+ (*s)++; /* Move past the '{' */
+ while (isXDIGIT(**s)) { /* Position beyond the legal digits */
+ (*s)++;
+ }
+ /* XXX The corresponding message above for \o is just '\\o{'; other
+ * messages for other constructs include the '}', so are inconsistent.
+ */
+ *error_msg = "Missing right brace on \\x{}";
+ return FALSE;
+ }
+
+ (*s)++; /* Point to expected first digit (could be first byte of utf8
+ sequence if not a digit) */
+ numbers_len = e - *s;
+ if (numbers_len == 0) {
+ if (strict) {
+ (*s)++; /* Move past the } */
+ *error_msg = "Number with no digits";
+ return FALSE;
+ }
+ return TRUE;
+ }
+
+ flags |= PERL_SCAN_ALLOW_UNDERSCORES;
+ if (silence_non_portable) {
+ flags |= PERL_SCAN_SILENT_NON_PORTABLE;
+ }
+
+ *uv = grok_hex(*s, &numbers_len, &flags, NULL);
+ /* Note that if has non-hex, will ignore everything starting with that up
+ * to the '}' */
+
+ if (strict && numbers_len != (STRLEN) (e - *s)) {
+ *s += numbers_len;
+ *s += (UTF) ? UTF8SKIP(*s) : 1;
+ *error_msg = "Non-hex character";
+ return FALSE;
+ }
+
+ /* Return past the '}' */
+ *s = e + 1;
+
+ return TRUE;