History

20100719-2257

forsyth committed 16 years ago

Commit 5c8f9fd1 parent 4bd9ce15 files · +34 −14Browse files

Unified · Split

5 files
  1. CHANGES +2 −0
  2. appl/cmd/disk/mkfs.b +11 −11
  3. dis/disk/mkfs.dis +0 −0
  4. include/version.h +1 −1
  5. libnandfs/NOTICE +21 −3
CHANGES+2−0
@@ -1,3 +1,5 @@
1+20100719
2+ appl/cmd/disk/mkfs.b change getname/getpath to cope with missing newline [issue 236]
13 20100715
24 appl/wm/toolbar.b changed not to create new /chan/snarf if one exists, unless -p (private) option given [toolbar(1)]
35 utils/cc/macbody - add overlooked change to implement __VA_ARGS__
appl/cmd/disk/mkfs.b+11−11
@@ -556,35 +556,35 @@ getfile(old: ref File): (ref File, big) · 555 unmodified lines
556556
557557 getpath(p: string): string
558558 {
559− for(; (c := p[0]) == ' ' || c == '\t'; p = p[1:])
559+ for(i := 0; i < len p && (p[i] == ' ' || p[i] == '\t'); i++)
560560 ;
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++)
562562 ;
563− return p[0:n];
563+ return p[i:n];
564564 }
565565
566566 getname(p: string): (string, string)
567567 {
568− for(; (c := p[0]) == ' ' || c == '\t'; p = p[1:])
568+ for(i := 0; i < len p && (p[0] == ' ' || p[0] == '\t'); i++)
569569 ;
570− i := 0;
571570 s := "";
572571 quoted := 0;
573− for(; (c = p[0]) != '\n' && (c != ' ' && c != '\t' || quoted); p = p[1:]){
574− if(quoted && c == '\'' && p[1] == '\'')
575− p = p[1:];
576− else if(c == '\''){
572+ for(; i < len p && (c := p[i]) != '\n' && (c != ' ' && c != '\t' || quoted); i++){
573+ if(c == '\''){
574+ if(i+1 >= len p || p[i+1] != '\''){
577575 quoted = !quoted;
578576 continue;
579577 }
580− s[i++] = c;
578+ i++;
579+ }
580+ s[len s] = c;
581581 }
582582 if(len s > 0 && s[0] == '$'){
583583 s = getenv(s[1:]);
584584 if(s == nil)
585585 error(sys->sprint("can't read environment variable %q", s));
586586 }
587− return (s, p);
587+ return (s, p[i:]);
588588 }
589589
590590 getenv(s: string): string
dis/disk/mkfs.dis+0−0

Binary file not shown.

include/version.h+1−1
@@ -1 +1 @@
1−#define VERSION "Fourth Edition (20100718)"
1+#define VERSION "Fourth Edition (20100719)"
libnandfs/NOTICE+21−3
@@ -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+
29 Copyright © 2002, 2003 Vita Nuova Holdings Limited.
310
4−The source and binary code for libnandfs may be used only as part of Inferno,
5−unless otherwise agreed with Vita Nuova.
11+This program is free software; you can redistribute it and/or modify
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.