aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss@ulticom.com>2012-03-23 01:41:59 +0000
committerJeff Morriss <jeff.morriss@ulticom.com>2012-03-23 01:41:59 +0000
commit9c1bf7223e576acaa9452f06c3cf809c98794cc7 (patch)
tree32797a9cd8a9e28bde09163cf245e986b31f2864 /file.c
parent4efb92a2746f6fe4b2f93d68a1e200c30abfd647 (diff)
Don't mark the file as unsaved unless the capture or packet comments actually changed.
svn path=/trunk/; revision=41744
Diffstat (limited to 'file.c')
-rw-r--r--file.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/file.c b/file.c
index 5d8d8e624b..b8692b6a2f 100644
--- a/file.c
+++ b/file.c
@@ -3658,10 +3658,9 @@ cf_unignore_frame(capture_file *cf, frame_data *frame)
const gchar*
cf_read_shb_comment(capture_file *cf)
{
- wtapng_section_t* shb_inf;
+ wtapng_section_t *shb_inf;
const gchar *temp_str;
-
/* Get info from SHB */
shb_inf = wtap_file_get_shb_info(cf->wth);
if(shb_inf == NULL)
@@ -3676,10 +3675,23 @@ cf_read_shb_comment(capture_file *cf)
void
cf_update_capture_comment(capture_file *cf, gchar *comment)
{
+ wtapng_section_t *shb_inf;
/* Get info from SHB */
- wtap_write_shb_comment(cf->wth, comment);
+ shb_inf = wtap_file_get_shb_info(cf->wth);
+ /* See if the comment has changed or not */
+ if (shb_inf && shb_inf->opt_comment) {
+ if (strcmp(shb_inf->opt_comment, comment) == 0) {
+ g_free(comment);
+ return;
+ }
+ }
+
+ /* The comment has changed, let's update it */
+ wtap_write_shb_comment(cf->wth, comment);
+ /* Mark the file as unsaved */
+ cf->user_saved = FALSE;
}
typedef struct {