Skip to content
Snippets Groups Projects
Forked from Utils / KWSys
551 commits behind the upstream repository.
Peter Wu's avatar
Peter Wu authored
LLVM libc++ as included with Mac OS X 10.7 suffers from an issue where
the trailing character is discarded when the delimiter (LF) is not found
within the given buffer size (1024).  The returned length is also 1024
rather than 1023.

This issue results in truncated reads as observed with CMake 3.11.0 on
Mac OS X 10.7 and `cmake -E cmake_link_script link.txt`.

Solve this by replacing `istream::getline` by `std::getline` which does
not trigger the buffering issue.  There is one edge case that I decided
to leave up to the callers though: a file containing `\0` previously
resulted in line truncation, but is now included in the result.

Tested with Mac OS X 10.7 and 10.11:

    -DCMAKE_OSX_DEPLOYMENT_TARGET=10.7 -DCMAKE_CXX_FLAGS=-stdlib=libc++

and `./kwsysTestsCxx testSystemTools`.

Issue: cmake/cmake#15039
898dc6b9
History

KWSys

Introduction

KWSys is the Kitware System Library. It provides platform-independent APIs to many common system features that are implemented differently on every platform. This library is intended to be shared among many projects at the source level, so it has a configurable namespace. Each project should configure KWSys to use a namespace unique to itself. See comments in CMakeLists.txt for details.

License

KWSys is distributed under the OSI-approved BSD 3-clause License. See Copyright.txt for details.

Reporting Bugs

KWSys has no independent issue tracker. After encountering an issue (bug) please submit a patch using the instructions for Contributing. Otherwise please report the issue to the tracker for the project that hosts the copy of KWSys in which the problem was found.

Contributing

See CONTRIBUTING.rst for instructions to contribute.