Unified · Split
| @@ -1,3 +1,5 @@ | |||
| 1 | 20100719 | ||
| 2 | appl/cmd/disk/mkfs.b change getname/getpath to cope with missing newline [issue 236] | ||
| 1 | 20100715 | 3 | 20100715 |
| 2 | appl/wm/toolbar.b changed not to create new /chan/snarf if one exists, unless -p (private) option given [toolbar(1)] | 4 | appl/wm/toolbar.b changed not to create new /chan/snarf if one exists, unless -p (private) option given [toolbar(1)] |
| 3 | utils/cc/macbody - add overlooked change to implement __VA_ARGS__ | 5 | utils/cc/macbody - add overlooked change to implement __VA_ARGS__ |
| @@ -556,35 +556,35 @@ getfile(old: ref File): (ref File, big) · 555 unmodified lines | |||
| 556 | 556 | ||
| 557 | getpath(p: string): string | 557 | getpath(p: string): string |
| 558 | { | 558 | { |
| 559 | for(; (c := p[0]) == ' ' || c == '\t'; p = p[1:]) | 559 | for(i := 0; i < len p && (p[i] == ' ' || p[i] == '\t'); i++) |
| 560 | ; | 560 | ; |
| 561 | for(n := 0; (c = p[n]) != '\n' && c != ' ' && c != '\t'; n++) | 561 | for(n := i; n < len p && (c := p[n]) != '\n' && c != ' ' && c != '\t'; n++) |
| 562 | ; | 562 | ; |
| 563 | return p[0:n]; | 563 | return p[i:n]; |
| 564 | } | 564 | } |
| 565 | 565 | ||
| 566 | getname(p: string): (string, string) | 566 | getname(p: string): (string, string) |
| 567 | { | 567 | { |
| 568 | for(; (c := p[0]) == ' ' || c == '\t'; p = p[1:]) | 568 | for(i := 0; i < len p && (p[0] == ' ' || p[0] == '\t'); i++) |
| 569 | ; | 569 | ; |
| 570 | i := 0; | ||
| 571 | s := ""; | 570 | s := ""; |
| 572 | quoted := 0; | 571 | quoted := 0; |
| 573 | for(; (c = p[0]) != '\n' && (c != ' ' && c != '\t' || quoted); p = p[1:]){ | 572 | for(; i < len p && (c := p[i]) != '\n' && (c != ' ' && c != '\t' || quoted); i++){ |
| 574 | if(quoted && c == '\'' && p[1] == '\'') | 573 | if(c == '\''){ |
| 575 | p = p[1:]; | 574 | if(i+1 >= len p || p[i+1] != '\''){ |
| 576 | else if(c == '\''){ | ||
| 577 | quoted = !quoted; | 575 | quoted = !quoted; |
| 578 | continue; | 576 | continue; |
| 579 | } | 577 | } |
| 580 | s[i++] = c; | 578 | i++; |
| 579 | } | ||
| 580 | s[len s] = c; | ||
| 581 | } | 581 | } |
| 582 | if(len s > 0 && s[0] == '$'){ | 582 | if(len s > 0 && s[0] == '$'){ |
| 583 | s = getenv(s[1:]); | 583 | s = getenv(s[1:]); |
| 584 | if(s == nil) | 584 | if(s == nil) |
| 585 | error(sys->sprint("can't read environment variable %q", s)); | 585 | error(sys->sprint("can't read environment variable %q", s)); |
| 586 | } | 586 | } |
| 587 | return (s, p); | 587 | return (s, p[i:]); |
| 588 | } | 588 | } |
| 589 | 589 | ||
| 590 | getenv(s: string): string | 590 | getenv(s: string): string |
Binary file not shown.
| @@ -1 +1 @@ | |||
| 1 | #define VERSION "Fourth Edition (20100718)" | 1 | #define VERSION "Fourth Edition (20100719)" |
| @@ -1,5 +1,23 @@ | |||
| 1 | Developed 2002, 2003 by Vita Nuova Holdings Limited. | 1 | This copyright NOTICE applies to all files in this directory and |
| 2 | subdirectories, unless another copyright notice appears in a given | ||
| 3 | file or subdirectory. If you take substantial code from this software to use in | ||
| 4 | other programs, you must somehow include with it an appropriate | ||
| 5 | copyright notice that includes the copyright notice and the other | ||
| 6 | notices below. It is fine (and often tidier) to do that in a separate | ||
| 7 | file such as NOTICE, LICENCE or COPYING. | ||
| 8 | |||
| 2 | Copyright © 2002, 2003 Vita Nuova Holdings Limited. | 9 | Copyright © 2002, 2003 Vita Nuova Holdings Limited. |
| 3 | 10 | ||
| 4 | The source and binary code for libnandfs may be used only as part of Inferno, | 11 | This program is free software; you can redistribute it and/or modify |
| 5 | unless otherwise agreed with Vita Nuova. | 12 | it under the terms of the GNU General Public License as published by |
| 13 | the Free Software Foundation; either version 2 of the License, or | ||
| 14 | (at your option) any later version. | ||
| 15 | |||
| 16 | This program is distributed in the hope that it will be useful, | ||
| 17 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 18 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 19 | GNU General Public License for more details. | ||
| 20 | |||
| 21 | You should have received a copy of the GNU General Public License | ||
| 22 | along with this program; if not, write to the Free Software | ||
| 23 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||