aboutsummaryrefslogtreecommitdiffstats
path: root/gtk/about_dlg.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2004-12-31 00:26:36 +0000
committerGuy Harris <guy@alum.mit.edu>2004-12-31 00:26:36 +0000
commit6e622fd24edc8a6532d58dea8cdf8e6a5ec313f4 (patch)
tree738949b79c0a12c924ec7155b79a0aa9ebfc032f /gtk/about_dlg.c
parent6d24b27606da5b9a86bb13d3de3bd195d249a757 (diff)
downloadwireshark-6e622fd24edc8a6532d58dea8cdf8e6a5ec313f4.tar.gz
wireshark-6e622fd24edc8a6532d58dea8cdf8e6a5ec313f4.tar.bz2
wireshark-6e622fd24edc8a6532d58dea8cdf8e6a5ec313f4.zip
"gtk_entry_get_text()" returns a "const char *" - assign the result to
one. "get_basename()" doesn't modify its argument, and its callers don't modify the substring pointed to by the result, so make it take a "const char *" as an argument and return a "const char *". "find_last_pathname_separator()" doesn't modify its argument, so make it a "const char *" - but some of its callers pass a non-"const" "char *" and modify the result, so don't make its return value a "const char *". And, as none of its callers are outside "filesystem.c", make it static. In "about_folders_page_new()", have separate variables for pathnames returned as "const char *" (which are cached by the routine that returns them, so you can't modify them - and can't free them, so get rid of the commented-out "g_free()" calls for them) and pathnames returned as "char *" (which are allocated anew for each call, and can be modified, but have to be freed). Clean up white space. svn path=/trunk/; revision=12881
Diffstat (limited to 'gtk/about_dlg.c')
-rw-r--r--gtk/about_dlg.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/gtk/about_dlg.c b/gtk/about_dlg.c
index f2bff7f274..d236993461 100644
--- a/gtk/about_dlg.c
+++ b/gtk/about_dlg.c
@@ -204,11 +204,11 @@ static GtkWidget *
about_folders_page_new(void)
{
GtkWidget *table;
- const char *path;
+ const char *constpath;
+ char *path;
gchar *titles[] = { "Name", "Folder", "Typical Files"};
GtkWidget *scrolledwindow;
-
scrolledwindow = scrolled_window_new(NULL, NULL);
#if GTK_MAJOR_VERSION >= 2
gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolledwindow),
@@ -235,20 +235,18 @@ about_folders_page_new(void)
g_free((void *) path);
/* global conf */
- path = get_datafile_dir();
- about_folders_row(table, "Global configuration", path,
+ constpath = get_datafile_dir();
+ about_folders_row(table, "Global configuration", constpath,
"\"dfilters\", \"preferences\", \"manuf\", ...");
- /*g_free(path);*/
/* system */
- path = get_systemfile_dir();
- about_folders_row(table, "System", path,
+ constpath = get_systemfile_dir();
+ about_folders_row(table, "System", constpath,
"\"ethers\", \"ipxnets\"");
- /*g_free(path);*/
/* program */
path = g_strdup(ethereal_path);
- path = get_dirname((char *) path);
+ path = get_dirname(path);
about_folders_row(table, "Program", path,
"program files");
g_free((void *) path);