Updated upb to allow nonzero offset minutes in JSON timestamps. (#8258)
* Updated upb to allow nonzero offset minutes in JSON timestamps.
This is to pick up https://github.com/protocolbuffers/upb/pull/367
* Reverted error message change.
* Fixed quote chars.
diff --git a/ruby/ext/google/protobuf_c/ruby-upb.c b/ruby/ext/google/protobuf_c/ruby-upb.c
index 9c048da..a7aeda2 100755
--- a/ruby/ext/google/protobuf_c/ruby-upb.c
+++ b/ruby/ext/google/protobuf_c/ruby-upb.c
@@ -7793,7 +7793,8 @@
{
/* [+-]08:00 or Z */
- int ofs = 0;
+ int ofs_hour = 0;
+ int ofs_min = 0;
bool neg = false;
if (ptr == end) goto malformed;
@@ -7804,9 +7805,10 @@
/* fallthrough */
case '+':
if ((end - ptr) != 5) goto malformed;
- ofs = jsondec_tsdigits(d, &ptr, 2, ":00");
- ofs *= 60 * 60;
- seconds.int64_val += (neg ? ofs : -ofs);
+ ofs_hour = jsondec_tsdigits(d, &ptr, 2, ":");
+ ofs_min = jsondec_tsdigits(d, &ptr, 2, NULL);
+ ofs_min = ((ofs_hour * 60) + ofs_min) * 60;
+ seconds.int64_val += (neg ? ofs_min : -ofs_min);
break;
case 'Z':
if (ptr != end) goto malformed;
diff --git a/ruby/ext/google/protobuf_c/ruby-upb.h b/ruby/ext/google/protobuf_c/ruby-upb.h
index 106c73b..fa04393 100755
--- a/ruby/ext/google/protobuf_c/ruby-upb.h
+++ b/ruby/ext/google/protobuf_c/ruby-upb.h
@@ -4161,7 +4161,6 @@
const upb_msgdef *upb_filedef_msg(const upb_filedef *f, int i);
const upb_enumdef *upb_filedef_enum(const upb_filedef *f, int i);
const upb_symtab *upb_filedef_symtab(const upb_filedef *f);
-upb_arena *_upb_symtab_arena(const upb_symtab *s);
/* upb_symtab *****************************************************************/
@@ -4179,6 +4178,7 @@
upb_symtab *s, const google_protobuf_FileDescriptorProto *file,
upb_status *status);
size_t _upb_symtab_bytesloaded(const upb_symtab *s);
+upb_arena *_upb_symtab_arena(const upb_symtab *s);
/* For generated code only: loads a generated descriptor. */
typedef struct upb_def_init {