Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:kssingvo
bidwatcher
bidwatcher-1.3.17-changes_20061123.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File bidwatcher-1.3.17-changes_20061123.patch of Package bidwatcher
--- bidwatcher-1.3.17/bidwatcher.cpp.orig 2006-11-23 12:16:32.000000000 +0100 +++ bidwatcher-1.3.17/bidwatcher.cpp 2006-11-23 12:16:05.000000000 +0100 @@ -3995,16 +3995,16 @@ } char buynow[40]; - if(auction->BuyitNowPrice > 0) { + if(auction->BuyitNowPrice > 0.00001) { sprintf(buynow, "%s%.2f", auction->currency, auction->BuyitNowPrice); } - if(auction->BuyitNowPrice > 0 && auction->CurrentBid > 0 && auction->BuyitNowPrice > auction->CurrentBid) { + if(auction->BuyitNowPrice > 0.00001 && auction->CurrentBid > 0 && auction->BuyitNowPrice > auction->CurrentBid) { sprintf(price, "%s / %s", curbid, buynow); return; } - if(auction->BuyitNowPrice > 0) { + if(auction->BuyitNowPrice > 0.00001) { if (is_dutch) { sprintf(price, "%s(D,B)", buynow); }else{ --- bidwatcher-1.3.17/helpers.cpp.orig 2006-11-23 12:16:32.000000000 +0100 +++ bidwatcher-1.3.17/helpers.cpp 2006-11-23 12:16:12.000000000 +0100 @@ -1094,6 +1094,8 @@ } for(i = 0; i < num_ship; i++) { DPRINTF(DLOW, ("parsing: >%s<\n", LineData)); + if (*LineData == '\0') + break; if(!parseprice(currency[i], ship[i], LineData)) { DPRINTF(DLOW, ("shipment price=%0.2f\n", ship[i])); ship[i] = 0; @@ -1213,21 +1215,20 @@ streamBuff.getline(LineBuffer.buf(), LineBuffer.size(), '\n'); if ( strstr(LineBuffer.buf(),"Another buyer used Buy It Now to purchase the item immediately") == NULL ){ - scratch = strstr(Buff, "Another buyer used Buy It Now to purchase the item immediately"); - if (scratch != NULL) { - if (strlen(Comments) > 0) { - if ( strstr(Comments, "Sold! BuyitNow") == NULL) { - strcpy(scratch,"Sold! BuyitNow "); - strcat(scratch,Comments); - strcpy(Comments,scratch); - } - } - else - { - if ( strstr(Comments, "Sold! BuyitNow") == NULL) strcpy(Comments, "Sold! BuyitNow"); - } + scratch = strstr(Buff, "Another buyer used Buy It Now to purchase the item immediately"); + if (scratch != NULL) { + if (strlen(Comments) > 0) { + if ( strstr(Comments, "Sold! BuyitNow") == NULL) { + strcpy(scratch,"Sold! BuyitNow "); + strcat(scratch,Comments); + strcpy(Comments,scratch); } - } + } else { + if ( strstr(Comments, "Sold! BuyitNow") == NULL) + strcpy(Comments, "Sold! BuyitNow"); + } + } + } if ( strstr(LineBuffer.buf(),"Auction ended early with Buy It Now") == NULL ){ scratch = strstr(Buff, "Auction ended early with Buy It Now"); @@ -1238,10 +1239,9 @@ strcat(scratch,Comments); strcpy(Comments,scratch); } - } - else - { - if ( strstr(Comments, "Sold! BuyitNow") == NULL) strcpy(Comments, "Sold! BuyitNow"); + } else { + if ( strstr(Comments, "Sold! BuyitNow") == NULL) + strcpy(Comments, "Sold! BuyitNow"); } } } @@ -1276,27 +1276,30 @@ scratch = strstr(Buff, "price:"); if (scratch != NULL) { scratch = strstr(Buff, "is the winner"); - if (scratch != NULL) isBuyitNow = 0; - else isBuyitNow = 1; + if (scratch != NULL) + isBuyitNow = 0; + else + isBuyitNow = 1; } } if (auc_type == TYPE_EBAYMOTORSCAR) { - scratch = strstr(Buff, "Current bid"); - if (scratch != NULL) { - scratch = strstr(Buff, "Starting bid"); + scratch = strstr(Buff, "Current bid"); if (scratch != NULL) { - // This is totally crazy and will break as soon as they muck with - // the html but it works for now to distinguish a Car auction from - // a part or accessory. Anyone want to offer a better suggestion? - - //Should move us ahead to a $. This check is here to make sure - //we aren't looking at something the seller said in his desc etc. - scratch +=16; + scratch = strstr(Buff, "Starting bid"); + if (scratch != NULL) { + // This is totally crazy and will break as soon as they muck with + // the html but it works for now to distinguish a Car auction from + // a part or accessory. Anyone want to offer a better suggestion? + + //Should move us ahead to a $. This check is here to make sure + //we aren't looking at something the seller said in his desc etc. + scratch +=16; - if (scratch[0] == '$') auc_type = TYPE_EBAYMOTORS; + if (scratch[0] == '$') + auc_type = TYPE_EBAYMOTORS; + } } } - } DPRINTF(DHIGH, ("Auction Type=%i\n", auc_type)); AuctionType = auc_type; @@ -1405,45 +1408,47 @@ case 34: // " price:" case 35: // "price:" DPRINTF(DLOW, ("This is a BuyItNow\n")); - if (!buynow_flag) { - buynow_flag = 1; + if (!buynow_flag) { + buynow_flag = 1; - int limit = strlen(LineBuffer.buf()); + int limit = strlen (LineBuffer.buf ()); - if ( limit < 7 ) { - strcpy(LineBuffertmp,LineBuffer.buf()); - streamBuff.getline(LineBuffer.buf(), LineBuffer.size(), '\n'); - strcat(LineBuffertmp,LineBuffer.buf()); - strcpy(LineBuffer.buf(),LineBuffertmp); - } + if (limit < 7) { + strcpy (LineBuffertmp, LineBuffer.buf ()); + streamBuff.getline (LineBuffer.buf (), LineBuffer.size (), '\n'); + strcat (LineBuffertmp, LineBuffer.buf ()); + strcpy (LineBuffer.buf (), LineBuffertmp); + } - scratch = strstr(LineBuffer.buf(), ":"); - if (*(scratch+1) == '\n') - streamBuff.getline(LineBuffer.buf(), LineBuffer.size(), '\n'); - //strcpy(LineBuffer.buf(),scratch); - parseprice2(scratch, this, FALSE); - if (!CurrentBid ) { - parseprice(scratch, this, TRUE); - } - if (!BidCount) { - if (!CurrentBid) CurrentBid = BuyitNowPrice; - strcpy(BidderRate, "(0)"); - FirstBid = CurrentBid; - if (has_ended_flag == 0 && !bid_flag) isEndless = 1; - } - } + scratch = strstr (LineBuffer.buf (), ":"); + if (*(scratch + 1) == '\n') + streamBuff.getline (LineBuffer.buf (), LineBuffer.size (), '\n'); + //strcpy(LineBuffer.buf(),scratch); + parseprice2 (scratch, this, FALSE); + if (!CurrentBid) { + parseprice (scratch, this, TRUE); + } + if (!BidCount) { + if (!CurrentBid) + CurrentBid = BuyitNowPrice; + strcpy (BidderRate, "(0)"); + FirstBid = CurrentBid; + if (has_ended_flag == 0 && !bid_flag) + isEndless = 1; + } + } break; case 4: // quantity if (!Quantity && !quant_flag) { - quant_flag=1; - if (strchr(LineBuffer.buf(), ':')) streamBuff.getline(LineBuffer.buf(), LineBuffer.size(), '\n'); + quant_flag=1; + if (strchr(LineBuffer.buf(), ':')) + streamBuff.getline(LineBuffer.buf(), LineBuffer.size(), '\n'); CheckBadChars(LineBuffer.buf(), "0123456789"); Quantity = atoi(LineBuffer.buf()); - DPRINTF(DLOW, ("LDBC: %s\n", LineBuffer.buf())); + DPRINTF(DLOW, ("LDBC: %s\n", LineBuffer.buf())); } break; - case 5: // bid count case 22: if (!BidCount) { @@ -1451,33 +1456,32 @@ // if instead of the number of bids an item has "Purchases" and // there was no time left in the auction the auction is not endless - int limit = strlen(LineBuffer.buf()); + int limit = strlen(LineBuffer.buf()); - if ( limit < 9 ) { - strcpy(LineBuffertmp,LineBuffer.buf()); - streamBuff.getline(LineBuffer.buf(), LineBuffer.size(), '\n'); - strcat(LineBuffertmp,LineBuffer.buf()); - strcpy(LineBuffer.buf(),LineBuffertmp); - } - scratch = strchr(LineBuffer.buf(), ':'); - if(scratch) { - int limit = strlen(scratch); - for ( int i=0; i < limit; i++ ) - { - // strip the ':' off the currentBid; - scratch[i] = scratch[i + 1]; - } - BidCount = atoi(scratch); - if (!BidCount) { - FirstBid = CurrentBid; - strcpy(HighBidder, "--"); - strcpy(BidderRate, "(0)"); - } - } else { - fprintf(stderr, "cannot determine BidCount: propably parser broken\n"); - } - DPRINTF(DLOW, ("BidCount: %i\n", BidCount)); + if ( limit < 9 ) { + strcpy(LineBuffertmp,LineBuffer.buf()); + streamBuff.getline(LineBuffer.buf(), LineBuffer.size(), '\n'); + strcat(LineBuffertmp,LineBuffer.buf()); + strcpy(LineBuffer.buf(),LineBuffertmp); } + scratch = strchr(LineBuffer.buf(), ':'); + if(scratch) { + int limit = strlen(scratch); + for ( int i=0; i < limit; i++ ) { + // strip the ':' off the currentBid; + scratch[i] = scratch[i + 1]; + } + BidCount = atoi(scratch); + if (!BidCount) { + FirstBid = CurrentBid; + strcpy(HighBidder, "--"); + strcpy(BidderRate, "(0)"); + } + } else { + fprintf(stderr, "cannot determine BidCount: propably parser broken\n"); + } + DPRINTF(DLOW, ("BidCount: %i\n", BidCount)); + } break; case 6: // time left if (!TimeLeft[0]) { @@ -1731,7 +1735,8 @@ /* Don't cut on '('! "(www.grahamcrackers.com)" is a valid ebay account */ /* strip only "(private)" away */ p = strstr(HighBidder, "(private)"); - if (p) *p='\0'; + if (p) + *p='\0'; /* remove trailing '(' in name, because its start of the ranking */ p = HighBidder+strlen(HighBidder)-1; if (*p == '(') { @@ -1763,6 +1768,8 @@ // break; case 13: // dutch auction + if (strncmp(LineBuffer.buf(), "This is a private listing.", 26) == 0) + break; streamBuff.getline(LineBuffer.buf(), LineBuffer.size(), '\n'); if (!strcmp(LineBuffer.buf(), "Dutch Auction")) strcpy(HighBidder, "Dutch Auction"); @@ -1948,8 +1955,10 @@ if(!buynow_flag) { isBuyitNow = 0; BuyitNowPrice = 0; + } +DPRINTF(DLOW, ("HighBidder: >%s< >%s<\n", HighBidder, BidderRate)); if (buynow_flag || (!strcmp(HighBidder, "Dutch Auction")) || (!strcmp(HighBidder, "see Dutch high bidders")) || @@ -1961,7 +1970,7 @@ HighBidder[2] = '\0'; } return TRUE; - } else if (!strcmp(HighBidder, "User ID kept private")) { + } else if (!strcmp(HighBidder, " User ID kept private ")) { strcpy(HighBidder, "private"); // it's nicer to have this text in log return TRUE; } else {
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor