Skip to content

Commit

Permalink
Export of internal Abseil changes
Browse files Browse the repository at this point in the history
--
3f99b3ea921adc3607b6f308646db9f893c4d55d by CJ Johnson <[email protected]>:

Import of CCTZ from GitHub.

PiperOrigin-RevId: 272051845

--
9a62831d763e39936239ff53460ede42c2a73afb by CJ Johnson <[email protected]>:

Fix spelling errors #384

PiperOrigin-RevId: 272015607

--
b9b51815d52cf17e987636d83adea28c262f3f1a by Abseil Team <[email protected]>:

Fix a spelling error

aligment -> alignment

PiperOrigin-RevId: 271629812

--
7965acbe7d7b5de18cfb2f2e5c0c18759313a229 by Abseil Team <[email protected]>:

Internal build system change.

PiperOrigin-RevId: 271476858

--
0b4508cbeff246c76762f80cbf8753a7414e4023 by Abseil Team <[email protected]>:

Internal change

PiperOrigin-RevId: 271450732

--
f8cb1aa2196cf2a5e7a474038519da8024090e7f by Samuel Benzaquen <[email protected]>:

Internal change

PiperOrigin-RevId: 271418668
GitOrigin-RevId: 3f99b3ea921adc3607b6f308646db9f893c4d55d
Change-Id: I8743e60d001d42f24cd7494f106eeb2eb07e6526
  • Loading branch information
Abseil Team authored and CJ-Johnson committed Sep 30, 2019
1 parent 882b350 commit debac94
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion absl/strings/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ package(
features = ["parse_headers"],
)

licenses(["notice"]) # Apache 2.0
licenses(["notice"])

cc_library(
name = "strings",
Expand Down
2 changes: 1 addition & 1 deletion absl/time/internal/cctz/include/cctz/civil_time.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ namespace cctz {
//
// All civil-time types have accessors for all six of the civil-time fields:
// year, month, day, hour, minute, and second. Recall that fields inferior to
// the type's aligment will be set to their minimum valid value.
// the type's alignment will be set to their minimum valid value.
//
// civil_day d(2015, 6, 28);
// // d.year() == 2015
Expand Down
10 changes: 5 additions & 5 deletions absl/time/internal/cctz/src/time_zone_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -631,11 +631,11 @@ class FileZoneInfoSource : public ZoneInfoSource {
std::unique_ptr<ZoneInfoSource> FileZoneInfoSource::Open(
const std::string& name) {
// Use of the "file:" prefix is intended for testing purposes only.
if (name.compare(0, 5, "file:") == 0) return Open(name.substr(5));
const std::size_t pos = (name.compare(0, 5, "file:") == 0) ? 5 : 0;

// Map the time-zone name to a path name.
std::string path;
if (name.empty() || name[0] != '/') {
if (pos == name.size() || name[pos] != '/') {
const char* tzdir = "/usr/share/zoneinfo";
char* tzdir_env = nullptr;
#if defined(_MSC_VER)
Expand All @@ -650,7 +650,7 @@ std::unique_ptr<ZoneInfoSource> FileZoneInfoSource::Open(
free(tzdir_env);
#endif
}
path += name;
path.append(name, pos, std::string::npos);

// Open the zoneinfo file.
FILE* fp = FOpen(path.c_str(), "rb");
Expand Down Expand Up @@ -680,7 +680,7 @@ class AndroidZoneInfoSource : public FileZoneInfoSource {
std::unique_ptr<ZoneInfoSource> AndroidZoneInfoSource::Open(
const std::string& name) {
// Use of the "file:" prefix is intended for testing purposes only.
if (name.compare(0, 5, "file:") == 0) return Open(name.substr(5));
const std::size_t pos = (name.compare(0, 5, "file:") == 0) ? 5 : 0;

// See Android's libc/tzcode/bionic.cpp for additional information.
for (const char* tzdata : {"/data/misc/zoneinfo/current/tzdata",
Expand Down Expand Up @@ -709,7 +709,7 @@ std::unique_ptr<ZoneInfoSource> AndroidZoneInfoSource::Open(
const std::int_fast32_t length = Decode32(ebuf + 44);
if (start < 0 || length < 0) break;
ebuf[40] = '\0'; // ensure zone name is NUL terminated
if (strcmp(name.c_str(), ebuf) == 0) {
if (strcmp(name.c_str() + pos, ebuf) == 0) {
if (fseek(fp.get(), static_cast<long>(start), SEEK_SET) != 0) break;
return std::unique_ptr<ZoneInfoSource>(new AndroidZoneInfoSource(
fp.release(), static_cast<std::size_t>(length), vers));
Expand Down

0 comments on commit debac94

Please sign in to comment.