aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/wutil.cpp
Commit message (Collapse)AuthorAge
* Remove an unnecessary c_str()Gravatar ridiculousfish2016-03-27
|
* Fix memory leaks at exit found in testsGravatar Andreas Nordal2016-03-27
| | | | | | | | | | This fixes all memory leaks found by compiling with clang++ -g -fsanitize=address and running the tests. Method: Ensure that memory is freed by the destructor of its respective container, either by storing objects directly instead of by pointer, or implementing the required destructor.
* fix handling of non-ASCII chars in C localeGravatar Kurtis Rader2016-03-20
| | | | | | | | | | | | The relevant standards allow the mbtowc/mbrtowc functions to reject non-ASCII characters (i.e., chars with the high bit set) when the locale is C or POSIX. The BSD libraries (e.g., on OS X) don't do this but the GNU libraries (e.g., on Linux) do. Like most programs we need the C/POSIX locales to allow arbitrary bytes. So explicitly check if we're in a single-byte locale (which would also include ISO-8859 variants) and simply pass-thru the chars without encoding or decoding. Fixes #2802.
* Attempt to fix the sporadic uvar test failures on LinuxGravatar ridiculousfish2015-11-08
| | | | | | | | | | | | | | | | | | We identify when the universal variable file has changed out from under us by comparing a bunch of fields from its stat: inode, device, size, high-precision timestamp, generation. Linux aggressively reuses inodes, and the size may be the same by coincidence (which is the case in the tests). Also, Linux officially has nanosecond precision, but in practice it seems to only uses millisecond precision for storing mtimes. Thus if there are three or more updates within a millisecond, every field we check may be the same, and we are vulnerable to the ABA problem. I believe this explains the occasional test failures. The solution is to manually set the nanosecond field of the mtime timestamp to something unlikely to be duplicated, like a random number, or better yet, the current time (with nanosecond precision). This is more in the spirit of the timestamp, and it means we're around a million times less likely to collide. This seems to fix the tests.
* Dead macro cleanupGravatar ridiculousfish2015-08-10
| | | | Enable -Wunused-macros, and remove said unused macros
* Add wreaddir_for_dirs functionGravatar ridiculousfish2015-08-08
| | | | Eliminates some stat calls, speeding up wildcard expansion
* Initial implementation of wildcard match refactoringGravatar ridiculousfish2015-08-08
| | | | Not yet turned on.
* src/wutil: drop <features.h> header, _BSD_SOURCE is defined by the compilerGravatar David Adam2015-07-26
|
* Merge branch 'master' into iwyuGravatar David Adam2015-07-26
|
* Make our wgettext() implementation a little less terrifyingGravatar ridiculousfish2015-07-25
| | | | Use wchar_t* directly instead of wcstring.c_str()
* Migrate source files into src/ directoryGravatar ridiculousfish2015-07-24
This change moves source files into a src/ directory, and puts object files into an obj/ directory. The Makefile and xcode project are updated accordingly. Fixes #1866