Module: wine
Branch: master
Commit: afa9d0a60da48a7efdca7114185b5e069b7b7c9b
URL: http://source.winehq.org/git/wine.git/?a=commit;h=afa9d0a60da48a7efdca71141…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Fri Jun 15 18:59:55 2007 +0200
regedit: Merge getRegClass() and getRegKeyName() to form parseKeyName().
Keep track of the full registry path (including the root key) in
currentKeyName. This makes the error messages more informative.
Reduce the number of global variables used by openKey() & co. Only
use one variable, currentKeyHandle, to indicate whether a key is
currently open or not.
---
programs/regedit/regproc.c | 209 ++++++++++++++++++++-----------------------
1 files changed, 97 insertions(+), 112 deletions(-)
Diff: http://source.winehq.org/git/wine.git/?a=commitdiff;h=afa9d0a60da48a7efdca7…
Module: wine
Branch: master
Commit: f6d5738d9a1a3117e2a43c4cb2ab673db37ed59e
URL: http://source.winehq.org/git/wine.git/?a=commit;h=f6d5738d9a1a3117e2a43c4cb…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Fri Jun 15 18:58:42 2007 +0200
regedit: Don't allow square-bracketed registry paths on the command line (to match native).
The only place they are allowed is in .reg files, so exclusively deal with them in processRegEntry().
Fix detection of the trailing ']' in processRegEntry(): it can be followed by some garbage.
---
programs/regedit/regproc.c | 54 ++++++++++++-------------------------------
1 files changed, 15 insertions(+), 39 deletions(-)
diff --git a/programs/regedit/regproc.c b/programs/regedit/regproc.c
index ee7e195..7fab52b 100644
--- a/programs/regedit/regproc.c
+++ b/programs/regedit/regproc.c
@@ -276,15 +276,13 @@ static LONG setValue(LPSTR val_name, LPSTR val_data)
/******************************************************************************
- * Extracts from [HKEY\some\key\path] or HKEY\some\key\path types of line
+ * Extracts from HKEY\some\key\path types of line
* the key class (what ends before the first '\')
*/
static BOOL getRegClass(LPSTR lpClass, HKEY* hkey)
{
LPSTR classNameEnd;
- LPSTR classNameBeg;
unsigned int i;
-
char lpClassCopy[KEY_MAX_LEN];
if (lpClass == NULL)
@@ -293,23 +291,11 @@ static BOOL getRegClass(LPSTR lpClass, HKEY* hkey)
lstrcpynA(lpClassCopy, lpClass, KEY_MAX_LEN);
classNameEnd = strchr(lpClassCopy, '\\'); /* The class name ends by '\' */
- if (!classNameEnd) /* or the whole string */
- {
- classNameEnd = lpClassCopy + strlen(lpClassCopy);
- if (classNameEnd[-1] == ']')
- {
- classNameEnd--;
- }
- }
- *classNameEnd = '\0'; /* Isolate the class name */
- if (lpClassCopy[0] == '[') {
- classNameBeg = lpClassCopy + 1;
- } else {
- classNameBeg = lpClassCopy;
- }
+ if (classNameEnd) /* or the whole string */
+ *classNameEnd = '\0'; /* Isolate the class name */
for (i = 0; i < REG_CLASS_NUMBER; i++) {
- if (!strcmp(classNameBeg, reg_class_names[i])) {
+ if (!strcmp(lpClassCopy, reg_class_names[i])) {
*hkey = reg_class_keys[i];
return TRUE;
}
@@ -318,7 +304,7 @@ static BOOL getRegClass(LPSTR lpClass, HKEY* hkey)
}
/******************************************************************************
- * Extracts from [HKEY\some\key\path] or HKEY\some\key\path types of line
+ * Extracts from HKEY\some\key\path types of line
* the key name (what starts after the first '\')
*/
static LPSTR getRegKeyName(LPSTR lpLine)
@@ -334,16 +320,6 @@ static LPSTR getRegKeyName(LPSTR lpLine)
keyNameBeg = strchr(lpLineCopy, '\\'); /* The key name start by '\' */
if (keyNameBeg) {
keyNameBeg++; /* is not part of the name */
-
- if (lpLine[0] == '[') /* need to find matching ']' */
- {
- LPSTR keyNameEnd;
-
- keyNameEnd = strrchr(lpLineCopy, ']');
- if (keyNameEnd) {
- *keyNameEnd = '\0'; /* remove ']' from the key name */
- }
- }
} else {
keyNameBeg = lpLineCopy + strlen(lpLineCopy); /* branch - empty string */
}
@@ -489,22 +465,22 @@ static void processRegEntry(LPSTR stdInput)
if ( stdInput[0] == '[') /* We are reading a new key */
{
+ LPSTR keyEnd;
if ( bTheKeyIsOpen != FALSE )
closeKey(); /* Close the previous key before */
+ /* Get rid of the square brackets */
+ stdInput++;
+ keyEnd = strrchr(stdInput, ']');
+ if (keyEnd)
+ *keyEnd='\0';
+
/* delete the key if we encounter '-' at the start of reg key */
- if ( stdInput[1] == '-')
+ if ( stdInput[0] == '-')
{
- int last_chr = strlen(stdInput) - 1;
-
- /* skip leading "[-" and get rid of trailing "]" */
- if (stdInput[last_chr] == ']')
- stdInput[last_chr] = '\0';
- delete_registry_key(stdInput+2);
- return;
+ delete_registry_key(stdInput+1);
}
-
- if ( openKey(stdInput) != ERROR_SUCCESS )
+ else if ( openKey(stdInput) != ERROR_SUCCESS )
fprintf(stderr,"%s: setValue failed to open key %s\n",
getAppName(), stdInput);
} else if( ( bTheKeyIsOpen ) &&
ChangeSet ID: 31219
CVSROOT: /opt/cvs-commit
Module name: appdb
Changes by: wineowner(a)winehq.org 2007/06/17 17:44:47
Modified files:
include : util.php
Log message:
Chris Morgan <cmorgan(a)alum.wpi.edu>
Cleanup make_bugzilla_version_list(). Use standard naming convention, add some documentation.
Add a work around so a selected version, if not present, is added to the list and selected.
This fixes the issue where editing an older test result leaves us in an unattainable position,
we can't select the version since it was pruned from the list and we don't want to pick the
wrong version for the results.
Patch: http://cvs.winehq.org/patch.py?id=31219
Old revision New revision Changes Path
1.94 1.95 +25 -8 appdb/include/util.php
Index: appdb/include/util.php
diff -u -p appdb/include/util.php:1.94 appdb/include/util.php:1.95
--- appdb/include/util.php:1.94 17 Jun 2007 22:44:47 -0000
+++ appdb/include/util.php 17 Jun 2007 22:44:47 -0000
@@ -154,11 +154,14 @@ function get_xml_tag ($file, $mode = nul
}
/* bugzilla functions */
-function make_bugzilla_version_list($varname, $cvalue)
-{
- $table = BUGZILLA_DB.".versions";
- $where = "WHERE product_id=".BUGZILLA_PRODUCT_ID;
- $sQuery = "SELECT value FROM $table $where";
+// $sVarname - name of the selection array that this function will output
+// this is the name to use to retrieve the selection on the form postback
+// $sSelectedValue - the currently selected entry
+function make_bugzilla_version_list($sVarname, $sSelectedValue)
+{
+ $sTable = BUGZILLA_DB.".versions";
+ $sWhere = "WHERE product_id=".BUGZILLA_PRODUCT_ID;
+ $sQuery = "SELECT value FROM $sTable $sWhere";
$hResult = query_bugzilladb($sQuery);
if(!$hResult) return;
@@ -195,15 +198,29 @@ function make_bugzilla_version_list($var
// build the selection array
- echo "<select name='$varname'>\n";
+ echo "<select name='$sVarname'>\n";
echo "<option value=\"\">Choose ...</option>\n";
+ $bFoundSelectedValue = false;
foreach($aVersions as $sKey => $sValue)
{
- if($sValue == $cvalue)
+ if($sValue == $sSelectedValue)
+ {
echo "<option value=$sValue selected>$sValue\n";
- else
+ $bFoundSelectedValue = true;
+ } else
+ {
echo "<option value=$sValue>$sValue\n";
+ }
}
+
+ // if we didn't find the selected value and the selected value isn't empty
+ // then we should add the selected value to the list because we could have pruned
+ // the version that is to be selected
+ if(!$bFoundSelectedValue && $sSelectedValue)
+ {
+ echo "<option value=$sSelectedValue selected>$sSelectedValue\n";
+ }
+
echo "</select>\n";
}
ChangeSet ID: 31217
CVSROOT: /opt/cvs-commit
Module name: appdb
Changes by: wineowner(a)winehq.org 2007/06/17 11:59:42
Modified files:
. : account.php
include : util.php
Log message:
Alexander Nicolaysen Sørnes <alex(a)thehandofagony.com>
Encode the sReturnTo argument to the login page, otherwise we may have problems with some urls
Patch: http://cvs.winehq.org/patch.py?id=31217
Old revision New revision Changes Path
1.36 1.37 +1 -1 appdb/account.php
1.93 1.94 +1 -1 appdb/include/util.php
Index: appdb/account.php
diff -u -p appdb/account.php:1.36 appdb/account.php:1.37
--- appdb/account.php:1.36 17 Jun 2007 16:59:42 -0000
+++ appdb/account.php 17 Jun 2007 16:59:42 -0000
@@ -209,7 +209,7 @@ function cmd_do_login()
if($iResult == SUCCESS)
{
- $sReturnUrl = $aClean['sReturnTo'];
+ $sReturnUrl = urldecode($aClean['sReturnTo']);
if(!$sReturnUrl)
$sReturnUrl = apidb_fullurl("index.php");
addmsg("You are successfully logged in as '$oUser->sRealname'.", "green");
Index: appdb/include/util.php
diff -u -p appdb/include/util.php:1.93 appdb/include/util.php:1.94
--- appdb/include/util.php:1.93 17 Jun 2007 16:59:42 -0000
+++ appdb/include/util.php 17 Jun 2007 16:59:42 -0000
@@ -907,7 +907,7 @@ function util_trim_description($sDescrip
to the current page once he has logged in */
function login_url()
{
- $sCurrentUrl = $_SERVER['REQUEST_URI'];
+ $sCurrentUrl = urlencode($_SERVER['REQUEST_URI']);
$sLoginUrl = BASE."account.php?sCmd=login";
/* If we are on the login page that means the URL already contains an sReturnTo value,
ChangeSet ID: 31215
CVSROOT: /opt/cvs-commit
Module name: appdb
Changes by: wineowner(a)winehq.org 2007/06/16 16:16:12
Modified files:
. : screenshots.php
Log message:
Chris Morgan <cmorgan(a)alum.wpi.edu>
Properly close all of the html frames we opened with html_frame_start(). Fixes a bug where the
back link appears inside of a frame and the page rendering time appears in an odd red bar at
the bottom of the page
Patch: http://cvs.winehq.org/patch.py?id=31215
Old revision New revision Changes Path
1.45 1.46 +6 -2 appdb/screenshots.php
Index: appdb/screenshots.php
diff -u -p appdb/screenshots.php:1.45 appdb/screenshots.php:1.46
--- appdb/screenshots.php:1.45 16 Jun 2007 21:16:12 -0000
+++ appdb/screenshots.php 16 Jun 2007 21:16:12 -0000
@@ -69,6 +69,9 @@ if($hResult && mysql_num_rows($hResult))
echo "<div align=center><table><tr>\n";
while($oRow = mysql_fetch_object($hResult))
{
+ // if the current version changed then update the current version
+ // and close the previous html frame if this isn't the
+ // first frame
if(!$aClean['iVersionId'] && $oRow->versionId != $currentVersionId)
{
if($currentVersionId)
@@ -77,7 +80,7 @@ if($hResult && mysql_num_rows($hResult))
echo html_frame_end();
$c=1;
}
- $currentVersionId=$oRow->versionId;
+ $currentVersionId = $oRow->versionId;
echo html_frame_start("Version ".Version::lookup_name($currentVersionId));
echo "<div align=center><table><tr>\n";
}
@@ -104,7 +107,8 @@ if($hResult && mysql_num_rows($hResult))
}
echo "</tr></table></div><br />\n";
- echo html_frame_end("Click thumbnail to view image in new window.");
+ echo html_frame_end(); // close the current version we are displaying
+ echo html_frame_end(); // close the "Screenshot Gallary..." html frame
} else {
echo "<p align=\"center\">There are currently no screenshots for the selected version of this application.";
echo "<br />Please consider submitting a screenshot for the selected version yourself.</p>";