Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:kssingvo
bidwatcher
bidwatcher-1.3.17-changes_20060921.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File bidwatcher-1.3.17-changes_20060921.patch of Package bidwatcher
--- bidwatcher-1.3.17/helpers.cpp.orig 2006-09-21 12:17:39.000000000 +0200 +++ bidwatcher-1.3.17/helpers.cpp 2006-09-21 14:28:20.000000000 +0200 @@ -1521,6 +1521,7 @@ } break; case 38: // Seller: + //Line looks currently like this 2006-09-21: "Seller: somename( 55) " if (!Seller[0]) { char *p; p = strchr(LineBuffer.buf(), ':'); @@ -1532,31 +1533,49 @@ STRNZCPY(Seller, p); /* strip only "(private)" away */ p = strstr(Seller, "(private)"); - if (p) *p='\0'; + if (p) + *p='\0'; - /* remove trailing '(' in name, because its start of the ranking */ - p = Seller+strlen(Seller)-1; - if (*p == '(') { + // remove trailing '(' in name, because its start of the ranking + // assumption that after '(' a space or a digit means is coming, + // means end of seller name is found. + // this fails, if Sellers name is like "abc(123)" and (123) is + // not the ranking, but part of his name + p = strrchr(Seller, '('); + if (p != NULL && (*(p+1) == ' ' || isdigit(*(p+1)))) { *p = '\0'; } + } - // Bidder Rate is typicaly in next line, but without leading '(' - streamBuff.getline(LineBuffer.buf(), LineBuffer.size(), '\n'); - if (LineBuffer.buf()[0] == '(' && !strchr(LineBuffer.buf(), ')')) - streamBuff.getline(LineBuffer.buf(), LineBuffer.size(), '\n'); - if (!strchr(LineBuffer.buf(), ')')) - break; // validity check - SellerRate[0] = '('; - unsigned int count; - for (count=1; count < sizeof(SellerRate)-1; count++) + if (!SellerRate[0]) { + char *p; + unsigned int src, dst; + + // New changes: 2006-SEP-21 + // Line looks like this: "Seller: somename( 55) " + if (strlen(LineBuffer.buf()) < strlen(Seller) + 10) + break; // validity check + + // don't work on line, work on buffer + // copy related part to SellerRate + p = strrchr(LineBuffer.buf(), '('); + if (p == NULL) { + strcpy(SellerRate, "unknown"); + break; + } + STRNZCPY(SellerRate, p); + + // eliminate spaces in Rating... + // copy bufffer to itself, but skip spaces + for(src=dst=0; src < sizeof(SellerRate) && SellerRate[src]; src++) + { + if (SellerRate[src] != ' ') { - if (LineBuffer.buf()[count-1] == '\0' || LineBuffer.buf()[count-1] == ')' - || LineBuffer.buf()[count-1] == ' ') - break; - SellerRate[count] = LineBuffer.buf()[count-1]; + SellerRate[dst] = SellerRate[src]; + dst++; } - SellerRate[count] = ')'; - SellerRate[count+1] = '\0'; + } + SellerRate[dst] = '\0'; if (!strncmp(SellerRate, "(0)", 4)) STRNZCPY(Feedbackn,"NONE"); }
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