Menu

#1 convenient cdrom parsing patch

open
nobody
None
5
2001-11-07
2001-11-07
Anonymous
No

diff -Naur stormpkg-2.30.2.old/debian/control stormpkg-2.30.2.new/debian/control
--- stormpkg-2.30.2.old/debian/control Wed Apr 25 08:08:06 2001
+++ stormpkg-2.30.2.new/debian/control Thu Nov 1 11:16:59 2001
@@ -3,7 +3,7 @@
Priority: optional
Maintainer: Ryan Murray <rmurray@debian.org>
Standards-Version: 3.1.1
-Build-Depends: debhelper, libgnome-dev, gettext, libapt-pkg-dev
+Build-Depends: debhelper, libgnome-dev, gettext, libapt-pkg-dev (>=0.5.4)

Package: stormpkg
Architecture: any
diff -Naur stormpkg-2.30.2.old/src/sources.cc stormpkg-2.30.2.new/src/sources.cc
--- stormpkg-2.30.2.old/src/sources.cc Sun Feb 18 07:34:59 2001
+++ stormpkg-2.30.2.new/src/sources.cc Fri Nov 2 22:29:53 2001
@@ -98,28 +98,56 @@
}

static char *strdup_possibly_quoted_word_and_return_next(char *from,char **to){
- char *s;
+ char *s, *Tmp, *OrigTmp;
char c;

- if (*from != '"'){
- for (s = from;*s;s++)
- if ((*s == ' ') || (*s == '\t') || (*s == '\n') || (*s == '\r'))
- break;
- } else {
- for (s = ++from;*s;s++)
- if (*s == '"')
- break;
- }
+ // Skip leading whitespace
+ for (;*from != 0 && isspace(*from) != 0 ; from++);
+
+// for (s = from; *s !=0 && isspace(*s) == 0 ;s++){
+// switch(*s){
+// case '"' :
+// for (++s;*s && *s != '"' ;s++);
+// break;
+// case '[' :
+// for (++s;*s && *s != ']';s++);
+// break;
+// }
+// };
+
+ for (s = from; *s !=0 && isspace(*s) == 0 ;s++){
+ if( *s == '"' )
+ for (++s;*s && *s != '"' ;s++);
+ if( *s == '[' )
+ for (++s;*s && *s != ']';s++);
+ };

+ // Save 'from'
c = *s;
if (c)
*s = '\0';
- *to = strdup(from);
+
+ Tmp = strdup(from);
+ OrigTmp = Tmp;
+
+ // De-quote Tmp
+ for (;*from;from++, Tmp++){
+ if(*from != '"')
+ *Tmp=*from;
+ else
+ Tmp--;
+ };
+ *Tmp = '\0';
+ *to = strdup(OrigTmp);
+ // Free Tmp
+ free(OrigTmp);
+
+ // Restore from
if (c)
*s++ = c;

- while ((*s == ' ') || (*s == '\t') || (*s == '\n') || (*s == '\r'))
- s++;
+// while (isspace(*s))
+// s++;
return s;
}

@@ -222,6 +250,7 @@
ec_write_autoquoted_string(fp,sp->type);
ec_write_string(fp," ");
ec_write_autoquoted_string(fp,sp->source_uri);
+// ec_write_string(fp,sp->source_uri);
ec_write_string(fp," ");
ec_write_autoquoted_string(fp,sp->distribution);
if (*sp->sections){

Discussion


Log in to post a comment.