Compare commits

..

4 Commits
0.0.3 ... 0.0.6

Author SHA1 Message Date
Andrew Gallant
3bb387abdd Fix glob problem on Windows.
We weren't actually escaping every use of the file path separator. D'oh.
2016-09-05 21:20:19 -04:00
Andrew Gallant
7f0273c347 Fix yellow color to match ack. 2016-09-05 21:19:56 -04:00
Andrew Gallant
5b42999a3d windows, take 3 2016-09-05 21:02:08 -04:00
Andrew Gallant
8887250860 windows, take 2 2016-09-05 20:58:50 -04:00
4 changed files with 7 additions and 24 deletions

View File

@@ -1,22 +1,3 @@
environment:
matrix:
- TARGET: x86_64-pc-windows-msvc
- TARGET: i686-pc-windows-gnu
install:
- ps: Start-FileDownload "https://static.rust-lang.org/dist/rust-nightly-${env:TARGET}.exe"
- rust-nightly-%TARGET%.exe /VERYSILENT /NORESTART /DIR="C:\Program Files (x86)\Rust"
- SET PATH=%PATH%;C:\Program Files (x86)\Rust\bin
- SET PATH=%PATH%;C:\MinGW\bin
- rustc -V
- cargo -V
build: false
test_script:
- cargo build --verbose
- cargo test --verbose
environment:
global:
PROJECT_NAME: xrep
@@ -56,7 +37,8 @@ test_script:
before_deploy:
# Generate artifacts for release
- RUSTFLAGS="-C target-feature=+ssse3" cargo build --release --features simd-accel
- SET RUSTFLAGS="-C target-feature=+ssse3"
- cargo build --release --features simd-accel
- mkdir staging
# TODO update this part to copy the artifacts that make sense for your project
- copy target\release\xrep.exe staging

View File

@@ -214,7 +214,7 @@ impl Pattern {
/// regular expression and will represent the matching semantics of this
/// glob pattern and the options given.
pub fn to_regex_with(&self, options: &MatchOptions) -> String {
let sep = path::MAIN_SEPARATOR.to_string();
let sep = regex::quote(&path::MAIN_SEPARATOR.to_string());
let mut re = String::new();
re.push_str("(?-u)");
if options.case_insensitive {
@@ -235,14 +235,14 @@ impl Pattern {
}
Token::Any => {
if options.require_literal_separator {
re.push_str(&format!("[^{}]", regex::quote(&sep)));
re.push_str(&format!("[^{}]", sep));
} else {
re.push_str(".");
}
}
Token::ZeroOrMore => {
if options.require_literal_separator {
re.push_str(&format!("[^{}]*", regex::quote(&sep)));
re.push_str(&format!("[^{}]*", sep));
} else {
re.push_str(".*");
}

View File

@@ -239,6 +239,7 @@ impl<W: Send + io::Write> Printer<W> {
fn line_number(&mut self, n: u64, sep: u8) {
if self.wtr.is_color() {
let _ = self.wtr.fg(YELLOW);
let _ = self.wtr.attr(term::Attr::Bold);
}
self.write(n.to_string().as_bytes());
if self.wtr.is_color() {

View File

@@ -37,6 +37,6 @@ pub fn stdout_is_atty() -> bool {
unsafe {
let fd = winapi::winbase::STD_OUTPUT_HANDLE;
let mut out = 0;
kernel32::GetConsoleMode(handle, &mut out) != 0
kernel32::GetConsoleMode(kernel32::GetStdHandle(fd), &mut out) != 0
}
}