diff options
author | Jisi Liu <jisi.liu@gmail.com> | 2017-08-18 16:25:35 -0700 |
---|---|---|
committer | Jisi Liu <jisi.liu@gmail.com> | 2017-08-18 16:25:35 -0700 |
commit | 139775ccc040a07e07c5407e34834dab27928cbc (patch) | |
tree | c500f4eabfea9d2e059f18b7d612c6e2a2db3ad5 /src/google/protobuf/util/internal/utility.cc | |
parent | 1825d6d8f0aedcd7966c5c137a71e46ae650b3da (diff) | |
parent | 26ac3e8e242f1cd6de15291a9973905a14b546ba (diff) | |
download | protobuf-139775ccc040a07e07c5407e34834dab27928cbc.tar.gz protobuf-139775ccc040a07e07c5407e34834dab27928cbc.tar.bz2 protobuf-139775ccc040a07e07c5407e34834dab27928cbc.zip |
Merge remote-tracking branch 'origin/3.4.x' into mergemaster
Diffstat (limited to 'src/google/protobuf/util/internal/utility.cc')
-rw-r--r-- | src/google/protobuf/util/internal/utility.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/google/protobuf/util/internal/utility.cc b/src/google/protobuf/util/internal/utility.cc index 8cf42e49..11780ee8 100644 --- a/src/google/protobuf/util/internal/utility.cc +++ b/src/google/protobuf/util/internal/utility.cc @@ -124,7 +124,10 @@ const StringPiece GetTypeWithoutUrl(StringPiece type_url) { return type_url.substr(kTypeUrlSize + 1); } else { size_t idx = type_url.rfind('/'); - return type_url.substr(idx + 1); + if (idx != type_url.npos) { + type_url.remove_prefix(idx + 1); + } + return type_url; } } |