diff --git a/client/cs_prefs.cpp b/client/cs_prefs.cpp index 07c420cbd2..c684bb0b6a 100644 --- a/client/cs_prefs.cpp +++ b/client/cs_prefs.cpp @@ -277,24 +277,12 @@ int CLIENT_STATE::check_suspend_processing() { // on some devices, running jobs can drain the battery even // while it's recharging. - // So use the following hysteresis policy: - // start computing when the batter is 95% charged. - // stop computing if it falls below 90%. - // Repeat. + // So compute only if 95% charged or more. // - static bool hyst_state = true; int cp = host_info.battery_charge_pct; - if (cp >= 0) { - if (cp < 90) { - hyst_state = true; - return SUSPEND_REASON_BATTERY_CHARGING; - } + if (cp >= 0) if (cp < 95) { - if (hyst_state) { - return SUSPEND_REASON_BATTERY_CHARGING; - } - } else { - hyst_state = false; + return SUSPEND_REASON_BATTERY_CHARGING; } } #endif diff --git a/client/hostinfo_unix.cpp b/client/hostinfo_unix.cpp index 9458cf0b43..fb73de3674 100644 --- a/client/hostinfo_unix.cpp +++ b/client/hostinfo_unix.cpp @@ -1315,6 +1315,9 @@ int HOST_INFO::get_virtualbox_version() { if (boinc_file_exists(path)) { #if LINUX_LIKE_SYSTEM + if (access(path, X_OK)) { + return 0; + } safe_strcpy(cmd, path); safe_strcat(cmd, " --version"); #elif defined( __APPLE__) diff --git a/clientgui/DlgAdvPreferences.cpp b/clientgui/DlgAdvPreferences.cpp index 4ec5951543..909b16f3a0 100644 --- a/clientgui/DlgAdvPreferences.cpp +++ b/clientgui/DlgAdvPreferences.cpp @@ -800,9 +800,9 @@ void CDlgAdvPreferences::OnAddExclusiveApp(wxCommandEvent&) { wxT("C:/Program Files"), wxT(""), wxT("*.exe"), wxFD_OPEN|wxFD_FILE_MUST_EXIST|wxFD_CHANGE_DIR|wxFD_MULTIPLE|wxFD_CHANGE_DIR); #else -//TODO: fill in the default directory and wildcard for Linux +//TODO: fill in the default directory for Linux wxFileDialog picker(this, _("Applications to add"), - wxT("/"), wxT(""), wxT("*.*"), + wxT("/"), wxT(""), wxT("*"), wxFD_OPEN|wxFD_FILE_MUST_EXIST|wxFD_CHANGE_DIR|wxFD_MULTIPLE|wxFD_CHANGE_DIR); #endif if (picker.ShowModal() != wxID_OK) return; diff --git a/clientgui/ViewWork.cpp b/clientgui/ViewWork.cpp index e538255924..037b903b75 100644 --- a/clientgui/ViewWork.cpp +++ b/clientgui/ViewWork.cpp @@ -233,7 +233,7 @@ CViewWork::CViewWork(wxNotebook* pNotebook) : m_pListPane->InsertColumn(COLUMN_STATUS, _("Status"), wxLIST_FORMAT_LEFT, 135); m_pListPane->InsertColumn(COLUMN_CPUTIME, _("Elapsed"), wxLIST_FORMAT_RIGHT, 80); m_pListPane->InsertColumn(COLUMN_TOCOMPLETION, _("Remaining (estimated)"), wxLIST_FORMAT_RIGHT, 100); - m_pListPane->InsertColumn(COLUMN_REPORTDEADLINE, _("Deadline"), wxLIST_FORMAT_LEFT, 150); + m_pListPane->InsertColumn(COLUMN_REPORTDEADLINE, _("Deadline"), wxLIST_FORMAT_RIGHT, 150); m_pListPane->InsertColumn(COLUMN_APPLICATION, _("Application"), wxLIST_FORMAT_LEFT, 95); m_pListPane->InsertColumn(COLUMN_NAME, _("Name"), wxLIST_FORMAT_LEFT, 285); diff --git a/html/inc/forum.inc b/html/inc/forum.inc index 9edd658816..ce5e740bb3 100644 --- a/html/inc/forum.inc +++ b/html/inc/forum.inc @@ -596,10 +596,11 @@ function show_post( echo tra("Credit: %1", number_format($user->total_credit)) ."
"; echo tra("RAC: %1", number_format($user->expavg_credit))."
"; } + // to use this feature: // - get flags from http://www.famfamfam.com/lab/icons/flags/famfamfam_flag_icons.zip // - put the .png's in html/user/flags/ - // - put define(COUNTRY_FLAGS, 1) in your html/project/project.inc + // - put define("COUNTRY_FLAGS", 1); in your html/project/project.inc // if (defined("COUNTRY_FLAGS")) { if (array_key_exists($user->country, $country_to_iso3166_2)) { diff --git a/html/ops/manage_user.php b/html/ops/manage_user.php index 2ff10ff65e..a5f0e0729d 100644 --- a/html/ops/manage_user.php +++ b/html/ops/manage_user.php @@ -37,6 +37,7 @@ db_init(); $is_admin = true; $Nbf = sizeof($special_user_bitfield); +$q = null; // Delete a user (or at least try to) // @@ -132,7 +133,9 @@ $id = get_int("userid", true); if (!$id) { $id = post_int("userid", true); } +if (!$id) error_page("No ID given"); $user = lookup_user_id($id); +if (!$user) error_page("No such user: $id"); // but clear if page was reset (forcing search form) diff --git a/lib/parse.cpp b/lib/parse.cpp index 824975a717..381358c821 100644 --- a/lib/parse.cpp +++ b/lib/parse.cpp @@ -229,14 +229,23 @@ int copy_element_contents(FILE* in, const char* end_tag, char* p, int len) { } int copy_element_contents(FILE* in, const char* end_tag, string& str) { - char buf[256]; + int c; + size_t end_tag_len = strlen(end_tag); + size_t n = 0; str = ""; - while (fgets(buf, 256, in)) { - if (strstr(buf, end_tag)) { - return 0; + while (1) { + c = fgetc(in); + if (c == EOF) break; + if (n >= end_tag_len) { + const char* p = str.c_str() + n - end_tag_len; + if (!strcmp(p, end_tag)) { + str.erase(n-end_tag_len, end_tag_len); + return 0; + } } - str += buf; + str += c; + n++; } return ERR_XML_PARSE; }