From 53c7492299e4bec56831bdc73180076aa3724763 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 13 Jun 2007 19:54:24 +0000 Subject: [PATCH] - parse_str(): remove unnecessary checks - client: allow app_info.xml to have multiple versions lib/ parse.C client/ client_state.C scheduler_op.C svn path=/trunk/boinc/; revision=12930 --- checkin_notes | 10 ++++++++++ client/client_state.C | 6 ++++-- client/scheduler_op.C | 2 +- doc/projects.inc | 2 +- lib/parse.C | 4 ---- 5 files changed, 16 insertions(+), 8 deletions(-) diff --git a/checkin_notes b/checkin_notes index f23aec7e35..ad4bcc83e2 100755 --- a/checkin_notes +++ b/checkin_notes @@ -6224,3 +6224,13 @@ David 13 June 2007 handle_request.C api/ boinc_api.C + +David 13 June 2007 + - parse_str(): remove unnecessary checks + - client: allow app_info.xml to have multiple versions + + lib/ + parse.C + client/ + client_state.C + scheduler_op.C diff --git a/client/client_state.C b/client/client_state.C index 94ba023ce0..2007767967 100644 --- a/client/client_state.C +++ b/client/client_state.C @@ -618,15 +618,17 @@ WORKUNIT* CLIENT_STATE::lookup_workunit(PROJECT* p, const char* name) { return 0; } -APP_VERSION* CLIENT_STATE::lookup_app_version(APP* app, char* platform, int version_num) { +APP_VERSION* CLIENT_STATE::lookup_app_version( + APP* app, char* platform, int version_num +) { for (unsigned int i=0; iapp != app) continue; + if (version_num != avp->version_num) continue; if (app->project->anonymous_platform) { return avp; } if (strcmp(avp->platform, platform)) continue; - if (version_num != avp->version_num) continue; return avp; } return 0; diff --git a/client/scheduler_op.C b/client/scheduler_op.C index ecdcc88e58..db296c47db 100644 --- a/client/scheduler_op.C +++ b/client/scheduler_op.C @@ -320,7 +320,6 @@ int SCHEDULER_OP::parse_master_file(PROJECT* p, vector &urls) { // char* q = buf; while (q && parse_str(q, "", str)) { - strip_whitespace(str); push_unique(str, urls); q = strstr(q, ""); if (q) q += strlen(""); @@ -334,6 +333,7 @@ int SCHEDULER_OP::parse_master_file(PROJECT* p, vector &urls) { if (n == 1) { char* q = strchr(buf2, '\"'); if (q) *q = 0; + strip_whitespace(buf2); str = string(buf2); push_unique(str, urls); } diff --git a/doc/projects.inc b/doc/projects.inc index cc1ba36d52..73146e657e 100644 --- a/doc/projects.inc +++ b/doc/projects.inc @@ -29,7 +29,7 @@ $biomed = array( ), array( "Predictor@home", - "http://predictor.scripps.edu", + "http://predictor.scripps.edu/", "Scripps Research Institute", "Biology", "Protein structure prediction starts from a sequence of amino acids and attempts to predict the folded, functioning, form of the protein. Predicting the structure of an unknown protein is a critical problem in enabling structure-based drug design to treat new and existing diseases.", diff --git a/lib/parse.C b/lib/parse.C index 26fbced06d..c263d83819 100644 --- a/lib/parse.C +++ b/lib/parse.C @@ -84,10 +84,6 @@ bool parse_str(const char* buf, const char* tag, char* dest, int destlen) { char tempbuf[1024]; int len; - // sanity check on NULL and empty cases. - if (!buf || !tag || !strlen(tag)) - return false; - p = strstr(buf, tag); if (!p) return false; p = strchr(p, '>');