File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed
branches/dist-snap/src/libnative/io Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ refs/heads/try: 1813e5aa1a03b0596b8de7abd1af31edf5d6098f
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
8
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9
- refs/heads/dist-snap: e12aeb39bc4221421890011006c5ae23154cc695
9
+ refs/heads/dist-snap: b6cce7ea5497977291f4ae57937360978e764e41
10
10
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
11
11
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
12
12
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
Original file line number Diff line number Diff line change @@ -409,16 +409,17 @@ fn make_command_line(prog: &str, args: &[~str]) -> ~str {
409
409
if quote {
410
410
cmd. push_char ( '"' ) ;
411
411
}
412
- for i in range ( 0 u, arg. len ( ) ) {
413
- append_char_at ( cmd, arg, i) ;
412
+ let argvec: Vec < char > = arg. chars ( ) . collect ( ) ;
413
+ for i in range ( 0 u, argvec. len ( ) ) {
414
+ append_char_at ( cmd, & argvec, i) ;
414
415
}
415
416
if quote {
416
417
cmd. push_char ( '"' ) ;
417
418
}
418
419
}
419
420
420
- fn append_char_at ( cmd : & mut StrBuf , arg : & str , i : uint ) {
421
- match arg[ i ] as char {
421
+ fn append_char_at ( cmd : & mut StrBuf , arg : & Vec < char > , i : uint ) {
422
+ match * arg. get ( i ) {
422
423
'"' => {
423
424
// Escape quotes.
424
425
cmd. push_str ( "\\ \" " ) ;
@@ -438,11 +439,11 @@ fn make_command_line(prog: &str, args: &[~str]) -> ~str {
438
439
}
439
440
}
440
441
441
- fn backslash_run_ends_in_quote ( s : & str , mut i : uint ) -> bool {
442
- while i < s. len ( ) && s [ i ] as char == '\\' {
442
+ fn backslash_run_ends_in_quote ( s : & Vec < char > , mut i : uint ) -> bool {
443
+ while i < s. len ( ) && * s . get ( i ) == '\\' {
443
444
i += 1 ;
444
445
}
445
- return i < s. len ( ) && s [ i ] as char == '"' ;
446
+ return i < s. len ( ) && * s . get ( i ) == '"' ;
446
447
}
447
448
}
448
449
You can’t perform that action at this time.
0 commit comments