Update of /cvsroot/bidwatcher/bidwatcher
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22254
Modified Files:
Tag: STABLE_1_3
helpers.cpp
Log Message:
Apply Klaus' description patch.
Index: helpers.cpp
===================================================================
RCS file: /cvsroot/bidwatcher/bidwatcher/Attic/helpers.cpp,v
retrieving revision 1.90.2.62
retrieving revision 1.90.2.63
diff -u -d -r1.90.2.62 -r1.90.2.63
--- helpers.cpp 11 Mar 2006 23:48:34 -0000 1.90.2.62
+++ helpers.cpp 11 Mar 2006 23:51:18 -0000 1.90.2.63
@@ -1112,6 +1112,7 @@
DPRINTF(DLOW, ("found 'eBay:' in auction, new type, scanning...\n"));
scratch = parseDescription(scratch, false);
+ DPRINTF(DLOW, ("Auction name = '%s'\n", Description));
} else {
scratch = strstr(Buff, "eBay Motors: ");
@@ -1845,7 +1846,8 @@
} // end GetAucInfo()
char *auctioninfo::parseDescription(char *scratch, bool motors) {
- unsigned int idx;
+ unsigned int idx, len;
+ char *end;
// move past the title
scratch += strlen(motors ? "eBay Motors: " : "eBay: ");
@@ -1854,7 +1856,14 @@
while (isspace(*scratch)) scratch++;
// copy over the description to a newline
idx = 0;
- while (*scratch != '\n' && idx < sizeof(Description) - 1) {
+ if ((end = strstr(scratch, "(item")) != NULL) {
+ len = end - scratch;
+ len = (len < sizeof(Description)-1) ? len : sizeof(Description-1);
+ } else {
+ len = sizeof(Description) - 1;
+ }
+
+ while (*scratch != '\n' && idx < len) {
Description[idx++] = *scratch++;
}
// NULL terminate the description I just parsed off
|