[2/8] regedit: Remove setAppName() as the application name is
hardcoded anyway.
Francois Gouget
fgouget at codeweavers.com
Thu Jun 14 04:36:54 CDT 2007
Move getAppName() to regedit.c which is where it belongs in case we later want to get the app name from argv[0].
---
If we ever decide to compute the application name from argv[0] we will
likely do it in regedit.c since that's where we parse de command line.
So it makes sense to put setAppName() there.
programs/regedit/regedit.c | 6 +++++-
programs/regedit/regproc.c | 16 ----------------
programs/regedit/regproc.h | 1 -
3 files changed, 5 insertions(+), 18 deletions(-)
diff --git a/programs/regedit/regedit.c b/programs/regedit/regedit.c
index 0c587d6..41ef204 100644
--- a/programs/regedit/regedit.c
+++ b/programs/regedit/regedit.c
@@ -59,6 +59,11 @@ typedef enum {
} REGEDIT_ACTION;
+const CHAR *getAppName(void)
+{
+ return "regedit";
+}
+
/******************************************************************************
* Copies file name from command line string to the buffer.
* Rewinds the command line string pointer to the next non-space character
@@ -229,7 +234,6 @@ BOOL ProcessCmdLine(LPSTR lpCmdLine)
LPSTR s = lpCmdLine; /* command line pointer */
CHAR ch = *s; /* current character */
- setAppName("regedit");
while (ch && ((ch == '-') || (ch == '/'))) {
char chu;
char ch2;
diff --git a/programs/regedit/regproc.c b/programs/regedit/regproc.c
index 2718194..c796d0b 100644
--- a/programs/regedit/regproc.c
+++ b/programs/regedit/regproc.c
@@ -40,8 +40,6 @@ static HKEY currentKeyClass = 0;
static HKEY currentKeyHandle = 0;
static BOOL bTheKeyIsOpen = FALSE;
-static const CHAR *app_name = "UNKNOWN";
-
static const CHAR *reg_class_names[] = {
"HKEY_LOCAL_MACHINE", "HKEY_USERS", "HKEY_CLASSES_ROOT",
"HKEY_CURRENT_CONFIG", "HKEY_CURRENT_USER", "HKEY_DYN_DATA"
@@ -1229,17 +1227,3 @@ void delete_registry_key(CHAR *reg_key_name)
}
HeapFree(GetProcessHeap(), 0, branch_name);
}
-
-/******************************************************************************
- * Sets the application name. Then application name is used in the error
- * reporting.
- */
-void setAppName(const CHAR *name)
-{
- app_name = name;
-}
-
-const CHAR *getAppName(void)
-{
- return app_name;
-}
diff --git a/programs/regedit/regproc.h b/programs/regedit/regproc.h
index 0b23c6a..b462546 100644
--- a/programs/regedit/regproc.h
+++ b/programs/regedit/regproc.h
@@ -39,7 +39,6 @@ BOOL export_registry_key(CHAR *file_name, CHAR *reg_key_name);
BOOL import_registry_file(LPTSTR filename);
void delete_registry_key(CHAR *reg_key_name);
-void setAppName(const CHAR *name);
const CHAR *getAppName(void);
void processRegLines(FILE *in, CommandAPI command);
--
1.4.4.4
More information about the wine-patches
mailing list