From 9d6d819c93ba39ede1579c3bbaf421a0cb1fb5bc Mon Sep 17 00:00:00 2001 From: Dan Werthimer Date: Thu, 22 May 2003 22:55:11 +0000 Subject: [PATCH] no message svn path=/trunk/boinc/; revision=1242 --- client/client_state.C | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/client/client_state.C b/client/client_state.C index 0fe21e908e..416e0580fd 100644 --- a/client/client_state.C +++ b/client/client_state.C @@ -884,11 +884,20 @@ int CLIENT_STATE::write_state_file_if_needed() { } // See if the project specified by master_url already exists -// in the client state record. +// in the client state record. Ignore any trailing "/" characters // PROJECT* CLIENT_STATE::lookup_project(char* master_url) { + int len1, len2; + char *mu; + + len1 = strlen(master_url); + if (master_url[strlen(master_url)-1] == '/') len1--; + for (unsigned int i=0; imaster_url)) { + mu = projects[i]->master_url; + len2 = strlen(mu); + if (mu[strlen(mu)-1] == '/') len2--; + if (!strncmp(master_url, projects[i]->master_url, max(len1,len2))) { return projects[i]; } }