Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=cfpm.git;a=commitdiff;h=c4bed9af635a7513b4d3cccd1b6ba3a31229022e

commit c4bed9af635a7513b4d3cccd1b6ba3a31229022e
Author: James Buren <r...@frugalware.org>
Date:   Thu Jun 4 13:02:59 2009 -0500

util.m
* update

diff --git a/util.m b/util.m
index a5620b8..bd55089 100644
--- a/util.m
+++ b/util.m
@@ -2,16 +2,23 @@
#include "util.h"

@implementation UString
-+ fscanf: (IOD) f count: (int) n
++ GetLine: (IOD) f
{
-       id str = [super new:n];
-       char buf[24];
+       id s = [super new];
+       char b[2];
+       int c;

-       sprintf(buf,"%%%ds",n);
+       b[1] = '\0';

-       fscanf(f,buf,[str str]);
+       while( (c = fgetc(f)) != EOF )
+       {
+               if(c == '\n')
+                       break;
+               b[0] = c;
+               [s concatSTR:b];
+       }

-       return str;
+       return s;
}
- lstrip: (BOOL) ls rstrip: (BOOL) rs
{
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to