| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
With widths lower than 4, the ElideMiddle function would crash because
its substring access would wrap around and attempt to access the max
size_t value. This patch fixes that.
|
| |
|
| |
|
|
|
|
| |
The VS compiler complained about possible loss of data (and it was right!)
|
|
|
|
|
|
|
| |
- 60 instead of 30 path components
- 64 instead of 32 backslashes in a path (windows only)
Issue: 1161
|
|
|
|
|
| |
"." is a legal path, if the string is empty after canonicalization
return ".".
|
|\
| |
| | |
whitespace/comment/wrap fixes, no intended functionality change
|
| | |
|
|/ |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Due to #690, file.c++ used to be escaped. + seems as safe as -, so allow
it to not be escaped, to keep compile command lines with a fairly common
extension slightly cleaner.
|
|
|
|
| |
Under ::CommandLineToArgvW() rules, the backslash character only gets special treatment if it’s immediately followed by a double quote. So, when checking to see if a string needs Win32 escaping, it’s sufficient to check for the presence of a double quote character. This allows paths like "foo\bar" to be recognised as “sensible” paths, which don’t require the full escaping.
|
|
|
|
|
|
| |
In summary: don’t escape if the path doesn’t contain problematic characters, otherwise:
- Shell: enclose string in single quotes, escape embedded single quotes with the magic quote-backslash-quote sequence
- Win32: Escape double quotes by doubling the number of consecutive backslashes that precede them (if any) and adding one more. Finally, double the number of trailing backslashes, and enclose the whole thing in double quotes.
|
|
|
|
| |
We "using namespace std" anywhere we need a std::string or a std::vector.
|
|\
| |
| | |
on windows a network path starts with two backslashes
|
| | |
|
|/
|
|
|
| |
Disable the size_t truncation warning. (Note that this leaves on
the other truncation-related warnings, like int->char.)
|
| |
|
| |
|
|
|
|
|
|
|
| |
This test covers bug fix introduced by 62e9139740. However,
reverting this patch does not trigger a test failure. Maybe, I am
not testing on the right platform (Linux). Anyway, in all cases
I think this test deserves to be added.
|
|
|
|
| |
From a patch from Peter Kuemmel <syntheticpp@gmx.net>.
|
|
|
|
| |
smart terminal.
|
|
|
|
| |
Fixes part of issue 121, but the fix exposed a further issue.
|
|
|
|
|
|
|
|
|
|
|
| |
This allows generating build files in a subdirectory of your source tree.
- Change CanonicalizePath to accept this.
- CanonicalizePath no longer has an error condition, so change it to a void
function.
I profiled the result against Chrome and it might be ~100ms slower, but that
might just be Chrome's size working against me. In any case I think there
are lower-hanging performance fruit elsewhere.
|
|
|
|
|
| |
We frequently do use absolute paths when depfiles refer to
e.g. /usr/include/stdio.h.
|
| |
|
|
Also add util_test.cc and move the CanonicalizePathTest into there.
Signed-off-by: Thiago Farina <tfarina@chromium.org>
|