===================================================================== Found a 38 line (181 tokens) duplication in the following files: Starting at line 950 of /home/tom/tmp/evo/evolution-1.5/mail/em-format-html.c Starting at line 188 of /home/tom/tmp/evo/evolution-1.5/mail/em-format-html-quote.c em_format_format_source(emf, stream, part); return; } /* sigh, so much for oo code reuse ... */ /* FIXME: put in a function */ nparts = camel_multipart_get_number(mp); content_type = camel_mime_part_get_content_type(part); start = camel_content_type_param (content_type, "start"); if (start && strlen(start)>2) { int len; const char *cid; /* strip <>'s */ len = strlen (start) - 2; start++; for (i=0; inext) { const char *uid = l->data; if (!strcmp (uid, e_source_peek_uid (source))) return TRUE; } return FALSE; } static ESource * find_first_source (ESourceList *source_list) { GSList *groups, *sources, *l, *m; groups = e_source_list_peek_groups (source_list); for (l = groups; l; l = l->next) { ESourceGroup *group = l->data; sources = e_source_group_peek_sources (group); for (m = sources; m; m = m->next) { ESource *source = m->data; return source; } } return NULL; } static void ===================================================================== Found a 32 line (176 tokens) duplication in the following files: Starting at line 3466 of /home/tom/tmp/evo/evolution-1.5/calendar/gui/e-day-view.c Starting at line 3360 of /home/tom/tmp/evo/evolution-1.5/calendar/gui/e-day-view.c !e_cal_util_component_has_recurrences (event->comp_data->icalcomp)) && (abs (canvas_x - day_view->drag_event_x) > E_DAY_VIEW_DRAG_START_OFFSET || abs (canvas_y - day_view->drag_event_y) > E_DAY_VIEW_DRAG_START_OFFSET)) { day_view->drag_event_day = day_view->pressed_event_day; day_view->drag_event_num = day_view->pressed_event_num; day_view->pressed_event_day = -1; /* Hide the horizontal bars. */ if (day_view->resize_bars_event_day != -1) { day_view->resize_bars_event_day = -1; day_view->resize_bars_event_num = -1; gnome_canvas_item_hide (day_view->main_canvas_top_resize_bar_item); gnome_canvas_item_hide (day_view->main_canvas_bottom_resize_bar_item); } target_list = gtk_target_list_new (target_table, n_targets); gtk_drag_begin (widget, target_list, GDK_ACTION_COPY | GDK_ACTION_MOVE, 1, (GdkEvent*)mevent); gtk_target_list_unref (target_list); } } else { cursor = day_view->normal_cursor; /* Recurring events can't be resized. */ if (event && (e_cal_util_component_is_instance (event->comp_data->icalcomp) || !e_cal_util_component_has_recurrences (event->comp_data->icalcomp))) { switch (pos) { case E_CALENDAR_VIEW_POS_LEFT_EDGE: ===================================================================== Found a 47 line (174 tokens) duplication in the following files: Starting at line 408 of /home/tom/tmp/evo/evolution-1.5/calendar/conduits/todo/todo-conduit.c Starting at line 402 of /home/tom/tmp/evo/evolution-1.5/calendar/conduits/calendar/calendar-conduit.c return -1; if (!e_cal_open (ctxt->client, FALSE, NULL)) return -1; return 0; } /* Utility routines */ static icaltimezone * get_timezone (ECal *client, const char *tzid) { icaltimezone *timezone = NULL; timezone = icaltimezone_get_builtin_timezone_from_tzid (tzid); if (timezone == NULL) e_cal_get_timezone (client, tzid, &timezone, NULL); return timezone; } static icaltimezone * get_default_timezone (void) { EConfigListener *listener; icaltimezone *timezone = NULL; char *location; listener = e_config_listener_new (); location = e_config_listener_get_string_with_default (listener, "/apps/evolution/calendar/display/timezone", "UTC", NULL); if (!location || !location[0]) { g_free (location); location = g_strdup ("UTC"); } timezone = icaltimezone_get_builtin_timezone (location); g_free (location); g_object_unref (listener); return timezone; } static char * ===================================================================== Found a 31 line (170 tokens) duplication in the following files: Starting at line 896 of /home/tom/tmp/evo/evolution-1.5/camel/camel-service.c Starting at line 772 of /home/tom/tmp/evo/evolution-1.5/camel/camel-service.c /* We cancel so if the thread impl is decent it causes immediate exit. We detach so we dont need to wait for it to exit if it isn't. We check the reply port incase we had a reply in the mean time, which we free later */ d(printf("Cancelling lookup thread and leaving it\n")); msg->cancelled = 1; pthread_detach(id); pthread_cancel(id); msg = (struct _lookup_msg *)e_msgport_get(reply_port); } else { struct _lookup_msg *reply = (struct _lookup_msg *)e_msgport_get(reply_port); g_assert(reply == msg); d(printf("waiting for child to exit\n")); pthread_join(id, NULL); d(printf("child done\n")); } } else { camel_exception_setv(&ex, CAMEL_EXCEPTION_SYSTEM, _("Host lookup failed: cannot create thread: %s"), g_strerror(err)); } e_msgport_destroy(reply_port); } camel_operation_end(NULL); if (!camel_exception_is_set(&ex)) { if (msg->result == 0) return &msg->hostbuf; if (msg->herr == HOST_NOT_FOUND || msg->herr == NO_DATA) camel_exception_setv (&ex, CAMEL_EXCEPTION_SYSTEM, ===================================================================== Found a 36 line (163 tokens) duplication in the following files: Starting at line 637 of /home/tom/tmp/evo/evolution-1.5/a11y/calendar/ea-day-view-main-item.c Starting at line 400 of /home/tom/tmp/evo/evolution-1.5/a11y/widgets/ea-calendar-item.c iface->ref_at = table_interface_ref_at; iface->get_n_rows = table_interface_get_n_rows; iface->get_n_columns = table_interface_get_n_columns; iface->get_index_at = table_interface_get_index_at; iface->get_column_at_index = table_interface_get_column_at_index; iface->get_row_at_index = table_interface_get_row_at_index; iface->get_column_extent_at = table_interface_get_column_extent_at; iface->get_row_extent_at = table_interface_get_row_extent_at; iface->is_selected = table_interface_is_selected; iface->get_selected_rows = table_interface_get_selected_rows; iface->get_selected_columns = table_interface_get_selected_columns; iface->is_row_selected = table_interface_is_row_selected; iface->is_column_selected = table_interface_is_column_selected; iface->add_row_selection = table_interface_add_row_selection; iface->remove_row_selection = table_interface_remove_row_selection; iface->add_column_selection = table_interface_add_column_selection; iface->remove_column_selection = table_interface_remove_column_selection; iface->get_row_header = table_interface_get_row_header; iface->get_column_header = table_interface_get_column_header; iface->get_caption = table_interface_get_caption; iface->get_summary = table_interface_get_summary; iface->get_row_description = table_interface_get_row_description; iface->get_column_description = table_interface_get_column_description; } static AtkObject* table_interface_ref_at (AtkTable *table, gint row, gint column) { gint index; ===================================================================== Found a 18 line (162 tokens) duplication in the following files: Starting at line 109 of /home/tom/tmp/evo/evolution-1.5/camel/tests/message/test3.c Starting at line 136 of /home/tom/tmp/evo/evolution-1.5/camel/tests/message/test3.c check(CAMEL_IS_MULTIPART(mp2)); check(camel_multipart_get_number(mp2) == 3); check(strcmp(camel_multipart_get_boundary(mp2), "_=,.XYZ_Kangaroo_Meat_is_!_ABADF00D") == 0); check(mp2->preface == NULL || strlen(mp2->preface) == 0); /* FIXME */ camel_test_nonfatal("postface may gain a single \\n?"); check_msg(mp2->postface == NULL || strlen(mp2->postface) == 0, "postface: '%s'", mp2->postface); camel_test_fatal(); test_message_compare_content(camel_medium_get_content_object(CAMEL_MEDIUM(camel_multipart_get_part(mp2, 0))), "content part 1", strlen("content part 1")); test_message_compare_content(camel_medium_get_content_object(CAMEL_MEDIUM(camel_multipart_get_part(mp2, 1))), "content part 3", strlen("content part 3")); test_message_compare_content(camel_medium_get_content_object(CAMEL_MEDIUM(camel_multipart_get_part(mp2, 2))), "content part 2", strlen("content part 2")); pull(); ===================================================================== Found a 17 line (160 tokens) duplication in the following files: Starting at line 50 of /home/tom/tmp/evo/evolution-1.5/camel/tests/stream/test3.c Starting at line 79 of /home/tom/tmp/evo/evolution-1.5/camel/tests/stream/test3.c for (i=0;isource) break; if (!p->modified && p->uid && p->source && camel_folder_has_summary_capability (p->source)) { GPtrArray *uids; uids = g_ptr_array_new (); g_ptr_array_add (uids, (char *) p->uid); camel_folder_transfer_messages_to (p->source, uids, outbox, NULL, FALSE, p->ex); g_ptr_array_free (uids, TRUE); } else { if (p->message == NULL) p->message = camel_folder_get_message (p->source, p->uid, p->ex); if (!p->message) continue; camel_folder_append_message (outbox, p->message, p->info, NULL, p->ex); } if (!camel_exception_is_set (p->ex)) ===================================================================== Found a 29 line (150 tokens) duplication in the following files: Starting at line 412 of /home/tom/tmp/evo/evolution-1.5/mail/em-migrate.c Starting at line 306 of /home/tom/tmp/evo/evolution-1.5/mail/evolution-mbox-upgrade.c g_warning ("cannot open `%s': %s", path, strerror (errno)); g_free (path); return; } while ((dent = readdir (dir))) { char *full_path; if (dent->d_name[0] == '.') continue; full_path = g_strdup_printf ("%s/%s", path, dent->d_name); if (stat (full_path, &st) == -1 || !S_ISDIR (st.st_mode)) { g_free (full_path); continue; } name = g_strdup_printf ("%s/%s", full_name, dent->d_name); em_migrate_dir (session, full_path, name); g_free (full_path); g_free (name); } closedir (dir); g_free (path); } static void ===================================================================== Found a 28 line (150 tokens) duplication in the following files: Starting at line 180 of /home/tom/tmp/evo/evolution-1.5/camel/providers/imapp/camel-imapp-store-summary.c Starting at line 180 of /home/tom/tmp/evo/evolution-1.5/camel/providers/imap/camel-imap-store-summary.c p = path = alloca(strlen(full_name)*3+1); f = full_name; while ( (c = *f++ & 0xff) ) { if (c == dir_sep) *p++ = '/'; else if (c == '/' || c == '%') p += sprintf(p, "%%%02X", c); else *p++ = c; } *p = 0; } else path = (char *)full_name; return camel_utf7_utf8(path); } static guint32 hexnib(guint32 c) { if (c >= '0' && c <= '9') return c-'0'; else if (c>='A' && c <= 'Z') return c-'A'+10; else return 0; } char * ===================================================================== Found a 20 line (127 tokens) duplication in the following files: Starting at line 369 of /home/tom/tmp/evo/evolution-1.5/calendar/importers/icalendar-importer.c Starting at line 521 of /home/tom/tmp/evo/evolution-1.5/calendar/importers/icalendar-importer.c g_strcasecmp (physical_uri + (strlen (physical_uri) - strlen (f)), f)) { real_uri = g_concat_dir_and_file (physical_uri, f); } else real_uri = g_strdup (physical_uri); /* create ECal's */ if (!ici->client) ici->client = e_cal_new_from_uri (real_uri, CALOBJ_TYPE_EVENT); if (!ici->tasks_client) ici->tasks_client = e_cal_new_from_uri ("", CALOBJ_TYPE_TODO); if (e_cal_open (ici->client, TRUE, NULL) && e_cal_open (ici->tasks_client, FALSE, NULL)) { ici->icalcomp = icalcomp; ret = TRUE; } g_free (real_uri); } ===================================================================== Found a 17 line (127 tokens) duplication in the following files: Starting at line 948 of /home/tom/tmp/evo/evolution-1.5/addressbook/printing/e-contact-print.c Starting at line 1041 of /home/tom/tmp/evo/evolution-1.5/addressbook/printing/e-contact-print.c ctxt->type = GNOME_PRINT_DIALOG_RESPONSE_PREVIEW; font_size = 72 * ctxt->style->page_height / 27.0 / 2.0; ctxt->letter_heading_font = gnome_font_find (gnome_font_get_name(ctxt->style->headings_font), gnome_font_get_size (ctxt->style->headings_font) * 1.5); ctxt->letter_tab_font = gnome_font_find (gnome_font_get_name(ctxt->style->headings_font), font_size); ctxt->pc = pc; #warning FIXME gnome_print_multipage_new_from_sizes #if 0 ctxt->pc = GNOME_PRINT_CONTEXT(gnome_print_multipage_new_from_sizes(pc, 72 * style->paper_width, 72 * style->paper_height, 72 * style->page_width, 72 * style->page_height)); #endif ctxt->book = book; ctxt->query = g_strdup(query); ===================================================================== Found a 25 line (126 tokens) duplication in the following files: Starting at line 60 of /home/tom/tmp/evo/evolution-1.5/addressbook/gui/contact-editor/e-contact-editor-marshal.c Starting at line 99 of /home/tom/tmp/evo/evolution-1.5/addressbook/gui/contact-list-editor/e-contact-list-editor-marshal.c gint arg_1, gpointer arg_2, gpointer data2); register GMarshalFunc_VOID__INT_OBJECT callback; register GCClosure *cc = (GCClosure*) closure; register gpointer data1, data2; g_return_if_fail (n_param_values == 3); if (G_CCLOSURE_SWAP_DATA (closure)) { data1 = closure->data; data2 = g_value_peek_pointer (param_values + 0); } else { data1 = g_value_peek_pointer (param_values + 0); data2 = closure->data; } callback = (GMarshalFunc_VOID__INT_OBJECT) (marshal_data ? marshal_data : cc->callback); callback (data1, g_marshal_value_peek_int (param_values + 1), g_marshal_value_peek_object (param_values + 2), data2); ===================================================================== Found a 17 line (125 tokens) duplication in the following files: Starting at line 4199 of /home/tom/tmp/evo/evolution-1.5/camel/camel-mime-utils.c Starting at line 4275 of /home/tom/tmp/evo/evolution-1.5/camel/camel-mime-utils.c outlen = headerlen+2; while (*inptr) { space = strchr(inptr, ' '); if (space) { len = space-inptr+1; } else { len = strlen(inptr); } d(printf("next word '%.*s'\n", len, inptr)); if (outlen + len > CAMEL_FOLD_SIZE) { d(printf("outlen = %d wordlen = %d\n", outlen, len)); /* strip trailing space */ if (out->len > 0 && out->str[out->len-1] == ' ') g_string_truncate(out, out->len-1); g_string_append(out, "\n\t"); outlen = 1; /* check for very long words, just cut them up */ ===================================================================== Found a 40 line (124 tokens) duplication in the following files: Starting at line 131 of /home/tom/tmp/evo/evolution-1.5/shell/e-config-upgrade.c Starting at line 281 of /home/tom/tmp/evo/evolution-1.5/camel/camel-file-utils.c camel_file_util_decode_string (FILE *in, char **str) { guint32 len; register char *ret; if (camel_file_util_decode_uint32 (in, &len) == -1) { *str = NULL; return -1; } len--; if (len > 65536) { *str = NULL; return -1; } ret = g_malloc (len+1); if (len > 0 && fread (ret, len, 1, in) != 1) { g_free (ret); *str = NULL; return -1; } ret[len] = 0; *str = ret; return 0; } /** * camel_mkdir: * @path: directory path to create * @mode: permissions * * Creates the directory path described in @path, creating any parent * directories as necessary. * * Returns 0 on success or -1 on fail. In the case of failure, errno * will be set appropriately. **/ ===================================================================== Found a 22 line (123 tokens) duplication in the following files: Starting at line 480 of /home/tom/tmp/evo/evolution-1.5/camel/providers/local/camel-mh-store.c Starting at line 379 of /home/tom/tmp/evo/evolution-1.5/camel/providers/local/camel-maildir-store.c { const struct _inode *v = d; return v->inode ^ v->dnode; } static gboolean inode_equal(const void *a, const void *b) { const struct _inode *v1 = a, *v2 = b; return v1->inode == v2->inode && v1->dnode == v2->dnode; } static void inode_free(void *k, void *v, void *d) { g_free(k); } static CamelFolderInfo * get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelException *ex) { CamelFolderInfo *fi = NULL; ===================================================================== Found a 29 line (121 tokens) duplication in the following files: Starting at line 77 of /home/tom/tmp/evo/evolution-1.5/camel/camel-lock-helper.c Starting at line 63 of /home/tom/tmp/evo/evolution-1.5/camel/camel-lock-client.c return -1; } else { left -= len; p += len; } } while (left > 0 && len != 0); return inlen - left; } static int write_n(int fd, void *buffer, int inlen) { char *p = buffer; int len, left = inlen; do { len = write(fd, p, left); if (len == -1) { if (errno != EINTR) return -1; } else { left -= len; p += len; } } while (left > 0); return inlen; } ===================================================================== Found a 35 line (120 tokens) duplication in the following files: Starting at line 143 of /home/tom/tmp/evo/evolution-1.5/camel/camel-mime-parser.c Starting at line 499 of /home/tom/tmp/evo/evolution-1.5/e-util/e-memory.c { MemPoolThresholdNode *tn, *tw; MemPoolNode *pw, *pn; tw = pool->threshold_blocks; while (tw) { tn = tw->next; g_free(tw); tw = tn; } pool->threshold_blocks = NULL; if (freeall) { pw = pool->blocks; while (pw) { pn = pw->next; g_free(pw); pw = pn; } pool->blocks = NULL; } else { pw = pool->blocks; while (pw) { pw->free = pool->blocksize; pw = pw->next; } } } /** * e_mempool_destroy: * @pool: * * Free all memory associated with a mempool. **/ ===================================================================== Found a 13 line (118 tokens) duplication in the following files: Starting at line 209 of /home/tom/tmp/evo/evolution-1.5/e-util/e-url.c Starting at line 151 of /home/tom/tmp/evo/evolution-1.5/camel/camel-url.c ===================================================================== Found a 19 line (117 tokens) duplication in the following files: Starting at line 199 of /home/tom/tmp/evo/evolution-1.5/a11y/calendar/ea-cal-view.c Starting at line 239 of /home/tom/tmp/evo/evolution-1.5/a11y/calendar/ea-cal-view.c return; ea_cal_view = EA_CAL_VIEW (atk_obj); if ((E_IS_DAY_VIEW (cal_view)) && event && event->canvas_item) { event_atk_obj = ea_calendar_helpers_get_accessible_for (event->canvas_item); } else if ((E_IS_WEEK_VIEW (cal_view)) && event) { EWeekViewEventSpan *span; EWeekViewEvent *week_view_event = (EWeekViewEvent *)event; EWeekView *week_view = E_WEEK_VIEW (cal_view); /* get the first span of the event */ span = &g_array_index (week_view->spans, EWeekViewEventSpan, week_view_event->spans_index); if (span && span->text_item) event_atk_obj = ea_calendar_helpers_get_accessible_for (span->text_item); } if (event_atk_obj) { ===================================================================== Found a 18 line (113 tokens) duplication in the following files: Starting at line 238 of /home/tom/tmp/evo/evolution-1.5/filter/filter-context.c Starting at line 175 of /home/tom/tmp/evo/evolution-1.5/filter/filter-context.c l = FILTER_FILTER (rule)->actions; while (l) { action = l->data; d(printf("checking action '%s'\n", action->name)); el = action->elements; while (el) { element = el->data; d(printf("checking element '%s'\n", element->name)); if (IS_FILTER_FOLDER (element)) { d(printf(" is folder, existing uri = '%s'\n", FILTER_FOLDER (element)->uri)); } if (IS_FILTER_FOLDER (element) ===================================================================== Found a 7 line (110 tokens) duplication in the following files: Starting at line 1030 of /home/tom/tmp/evo/evolution-1.5/calendar/gui/e-calendar-table.c Starting at line 1270 of /home/tom/tmp/evo/evolution-1.5/calendar/gui/e-cal-view.c pixmap_widget = gtk_image_new_from_stock (GTK_STOCK_OPEN, GTK_ICON_SIZE_MENU); else if (!strcmp (context_menu[i].name, _("_Paste"))) pixmap_widget = gtk_image_new_from_stock (GTK_STOCK_PASTE, GTK_ICON_SIZE_MENU); else if (!strcmp (context_menu[i].name, _("_Print..."))) pixmap_widget = gtk_image_new_from_stock (GTK_STOCK_PRINT, GTK_ICON_SIZE_MENU); else if (!strcmp (context_menu[i].name, _("_Save As..."))) pixmap_widget = gtk_image_new_from_stock (GTK_STOCK_SAVE_AS, GTK_ICON_SIZE_MENU); ===================================================================== Found a 30 line (109 tokens) duplication in the following files: Starting at line 132 of /home/tom/tmp/evo/evolution-1.5/camel/camel-mime-filter-basic.c Starting at line 230 of /home/tom/tmp/evo/evolution-1.5/camel/camel-mime-filter-basic.c /* "begin \n" has been found, so we can now start decoding */ camel_mime_filter_set_size (mf, len + 3, FALSE); newlen = camel_uudecode_step (in, len, mf->outbuf, &f->state, &f->save); } else { newlen = 0; } break; default: g_warning("unknown type %d in CamelMimeFilterBasic", f->type); goto donothing; } *out = mf->outbuf; *outlen = newlen; *outprespace = mf->outpre; return; donothing: *out = in; *outlen = len; *outprespace = prespace; } /** * camel_mime_filter_basic_new: * * Create a new CamelMimeFilterBasic object. * * Return value: A new CamelMimeFilterBasic widget. **/ ===================================================================== Found a 13 line (107 tokens) duplication in the following files: Starting at line 381 of /home/tom/tmp/evo/evolution-1.5/calendar/gui/e-week-view-event-item.c Starting at line 291 of /home/tom/tmp/evo/evolution-1.5/calendar/gui/e-week-view-event-item.c &bg_color)) { GdkColormap *colormap; colormap = gtk_widget_get_colormap (GTK_WIDGET (week_view)); if (gdk_colormap_alloc_color (colormap, &bg_color, TRUE, TRUE)) gdk_gc_set_foreground (gc, &bg_color); else gdk_gc_set_foreground (gc, &week_view->colors[E_WEEK_VIEW_COLOR_EVENT_BACKGROUND]); } else gdk_gc_set_foreground (gc, &week_view->colors[E_WEEK_VIEW_COLOR_EVENT_BACKGROUND]); gdk_draw_rectangle (drawable, gc, TRUE, rect_x, y1 + 1, rect_w, y2 - y1 - 1); gdk_gc_set_foreground (gc, &week_view->colors[E_WEEK_VIEW_COLOR_EVENT_BORDER]); ===================================================================== Found a 15 line (106 tokens) duplication in the following files: Starting at line 723 of /home/tom/tmp/evo/evolution-1.5/camel/camel-multipart-signed.c Starting at line 672 of /home/tom/tmp/evo/evolution-1.5/camel/camel-multipart-signed.c camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, _("parse error")); return NULL; } /* first, prepare our parts */ sub = camel_seekable_substream_new((CamelSeekableStream *)((CamelDataWrapper *)mps)->stream, mps->start1, mps->end1); constream = (CamelStream *)camel_stream_filter_new_with_stream(sub); camel_object_unref((CamelObject *)sub); /* Note: see rfc2015 or rfc3156, section 5 */ canon_filter = camel_mime_filter_canon_new (CAMEL_MIME_FILTER_CANON_CRLF); camel_stream_filter_add((CamelStreamFilter *)constream, (CamelMimeFilter *)canon_filter); camel_object_unref((CamelObject *)canon_filter); } ===================================================================== Found a 26 line (106 tokens) duplication in the following files: Starting at line 17 of /home/tom/tmp/evo/evolution-1.5/camel/tests/folder/test4.c Starting at line 17 of /home/tom/tmp/evo/evolution-1.5/camel/tests/folder/test5.c { CamelSession *session; CamelException *ex; int i; char *path; camel_test_init(argc, argv); ex = camel_exception_new(); /* clear out any camel-test data */ system("/bin/rm -rf /tmp/camel-test"); session = camel_test_session_new ("/tmp/camel-test"); /* todo: cross-check everything with folder_info checks as well */ /* todo: subscriptions? */ for (i=0;iparent_stream; /* Go to our position in the parent stream. */ if (!parent_reset (seekable_substream, parent)) { stream->eos = TRUE; return 0; } /* Compute how many bytes should be read. */ if (seekable_stream->bound_end != CAMEL_STREAM_UNBOUND) n = MIN (seekable_stream->bound_end - seekable_stream->position, n); if (n == 0) { stream->eos = TRUE; return 0; } ===================================================================== Found a 24 line (105 tokens) duplication in the following files: Starting at line 354 of /home/tom/tmp/evo/evolution-1.5/camel/camel-tcp-stream-raw.c Starting at line 538 of /home/tom/tmp/evo/evolution-1.5/camel/camel-tcp-stream-openssl.c close (fd); errno = EINTR; return -1; } else { len = sizeof (int); if (getsockopt (fd, SOL_SOCKET, SO_ERROR, &ret, &len) == -1) { close (fd); return -1; } if (ret != 0) { close (fd); errno = ret; return -1; } } fcntl (fd, F_SETFL, flags); } return fd; } ===================================================================== Found a 17 line (105 tokens) duplication in the following files: Starting at line 521 of /home/tom/tmp/evo/evolution-1.5/filter/vfolder-rule.c Starting at line 674 of /home/tom/tmp/evo/evolution-1.5/filter/rule-editor.c { GtkWidget *table, *scrolled; GtkTreeSelection *selection; GtkCellRenderer *renderer; GtkListStore *model; scrolled = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled), GTK_SHADOW_IN); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); model = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_POINTER); table = gtk_tree_view_new_with_model ((GtkTreeModel *) model); gtk_tree_view_set_headers_visible ((GtkTreeView *) table, FALSE); renderer = gtk_cell_renderer_text_new (); gtk_tree_view_insert_column_with_attributes ((GtkTreeView *) table, -1, ===================================================================== Found a 12 line (105 tokens) duplication in the following files: Starting at line 401 of /home/tom/tmp/evo/evolution-1.5/e-util/e-sexp.c Starting at line 369 of /home/tom/tmp/evo/evolution-1.5/e-util/e-sexp.c { struct _ESExpResult *r, *r1, *r2; r = e_sexp_result_new(f, ESEXP_RES_UNDEFINED); if (argc == 2) { r1 = e_sexp_term_eval(f, argv[0]); r2 = e_sexp_term_eval(f, argv[1]); if (r1->type != r2->type) { e_sexp_result_free(f, r1); e_sexp_result_free(f, r2); e_sexp_result_free(f, r); ===================================================================== Found a 22 line (104 tokens) duplication in the following files: Starting at line 290 of /home/tom/tmp/evo/evolution-1.5/camel/providers/imapp/camel-imapp-store.c Starting at line 924 of /home/tom/tmp/evo/evolution-1.5/camel/providers/imap/camel-imap-store.c if (camel_exception_get_id (ex) == CAMEL_EXCEPTION_SERVICE_UNAVAILABLE) { /* The ssl port seems to be unavailable, lets try STARTTLS */ camel_exception_clear (ex); return connect_to_server (service, ssl_mode, TRUE, ex); } else { return FALSE; } } return TRUE; } else if (ssl_mode == USE_SSL_WHEN_POSSIBLE) { /* If the server supports STARTTLS, use it */ return connect_to_server (service, ssl_mode, TRUE, ex); } else { /* User doesn't care about SSL */ return connect_to_server (service, ssl_mode, FALSE, ex); } #else return connect_to_server (service, USE_SSL_NEVER, FALSE, ex); #endif } ===================================================================== Found a 21 line (104 tokens) duplication in the following files: Starting at line 617 of /home/tom/tmp/evo/evolution-1.5/filter/filter-rule.c Starting at line 387 of /home/tom/tmp/evo/evolution-1.5/filter/filter-filter.c current = index; index++; } omenu = gtk_option_menu_new (); gtk_option_menu_set_menu (GTK_OPTION_MENU (omenu), menu); gtk_option_menu_set_history (GTK_OPTION_MENU (omenu), current); gtk_widget_show (omenu); gtk_box_pack_start (GTK_BOX (hbox), omenu, FALSE, FALSE, 0); if (p) gtk_box_pack_start (GTK_BOX (hbox), p, FALSE, FALSE, 0); gtk_widget_show_all (hbox); return hbox; } struct _rule_data { FilterRule *fr; ===================================================================== Found a 11 line (104 tokens) duplication in the following files: Starting at line 179 of /home/tom/tmp/evo/evolution-1.5/mail/em-format-html-display.c Starting at line 160 of /home/tom/tmp/evo/evolution-1.5/mail/em-format-html-display.c if (r+b+g > 128*3) { r = (r*SCALE) >> 8; g = (g*SCALE) >> 8; b = (b*SCALE) >> 8; } else { r = 128 - ((SCALE * r) >> 9); g = 128 - ((SCALE * g) >> 9); b = 128 - ((SCALE * b) >> 9); } ===================================================================== Found a 15 line (103 tokens) duplication in the following files: Starting at line 1748 of /home/tom/tmp/evo/evolution-1.5/calendar/gui/e-meeting-time-sel.c Starting at line 1660 of /home/tom/tmp/evo/evolution-1.5/calendar/gui/e-meeting-time-sel.c return; minutes_shown = (mts->day_end_hour - mts->day_start_hour) * 60; minutes_shown += mts->day_end_minute - mts->day_start_minute; if (hours * 60 + mins > minutes_shown) return; /* If the meeting time finishes past the end of the working day, move onto the start of the next working day. If the meeting time starts before the working day, move it on as well. */ if (start_time->hour > mts->day_end_hour || (start_time->hour == mts->day_end_hour && start_time->minute > mts->day_end_minute) || end_time->hour > mts->day_end_hour || (end_time->hour == mts->day_end_hour && end_time->minute > mts->day_end_minute)) { ===================================================================== Found a 11 line (103 tokens) duplication in the following files: Starting at line 367 of /home/tom/tmp/evo/evolution-1.5/filter/rule-context.c Starting at line 544 of /home/tom/tmp/evo/evolution-1.5/filter/rule-context.c rule_map = g_hash_table_lookup(rc->rule_set_map, set->name); if (rule_map) { d(printf("loading rules ...\n")); rule = set->children; while (rule) { d(printf("checking node: %s\n", rule->name)); if (!strcmp(rule->name, "rule")) { FilterRule *part = FILTER_RULE(g_object_new(rule_map->type, NULL, NULL)); if (filter_rule_xml_decode(part, rule, rc) == 0) { /* use the revert data to keep track of the right rank of this rule part */ ===================================================================== Found a 11 line (103 tokens) duplication in the following files: Starting at line 87 of /home/tom/tmp/evo/evolution-1.5/mail/mail-autofilter.c Starting at line 174 of /home/tom/tmp/evo/evolution-1.5/camel/camel-folder-thread.c while (*s) { while (isspace(*s)) s++; if (s[0] == 0) break; if ((s[0] == 'r' || s[0]=='R') && (s[1] == 'e' || s[1]=='E')) { p = s+2; while (isdigit(*p) || (ispunct(*p) && (*p != ':'))) p++; if (*p==':') { ===================================================================== Found a 15 line (103 tokens) duplication in the following files: Starting at line 203 of /home/tom/tmp/evo/evolution-1.5/camel/tests/folder/test3.c Starting at line 137 of /home/tom/tmp/evo/evolution-1.5/camel/tests/folder/test9.c for (j=0;j<100;j++) { char *content, *subject; push("creating test message"); msg = test_message_create_simple(); content = g_strdup_printf("data%d content\n", j); test_message_set_content_simple((CamelMimePart *)msg, 0, "text/plain", content, strlen(content)); test_free(content); subject = g_strdup_printf("Test%d message%d subject", j, 100-j); camel_mime_message_set_subject(msg, subject); camel_mime_message_set_date(msg, j*60*24, 0); pull(); ===================================================================== Found a 22 line (103 tokens) duplication in the following files: Starting at line 825 of /home/tom/tmp/evo/evolution-1.5/mail/em-utils.c Starting at line 1214 of /home/tom/tmp/evo/evolution-1.5/mail/em-utils.c /* Add In-Reply-To and References. */ message_id = camel_medium_get_header (CAMEL_MEDIUM (message), "Message-Id"); references = camel_medium_get_header (CAMEL_MEDIUM (message), "References"); if (message_id) { char *reply_refs; e_msg_composer_add_header (composer, "In-Reply-To", message_id); if (references) reply_refs = g_strdup_printf ("%s %s", references, message_id); else reply_refs = g_strdup (message_id); e_msg_composer_add_header (composer, "References", reply_refs); g_free (reply_refs); } else if (references) { e_msg_composer_add_header (composer, "References", references); } e_msg_composer_drop_editor_undo (composer); ===================================================================== Found a 24 line (102 tokens) duplication in the following files: Starting at line 443 of /home/tom/tmp/evo/evolution-1.5/camel/providers/pop3/camel-pop3-stream.c Starting at line 434 of /home/tom/tmp/evo/evolution-1.5/camel/providers/nntp/camel-nntp-stream.c return 1; } } state = 1; case 1: /* Scan for sentinal */ while ((*p++)!='\n') ; if (p > e) { p = e; } else { state = 0; } break; } } while ((e-p) >= 3); is->state = state; is->ptr = p; *len = p-s; *start = s; ===================================================================== Found a 12 line (102 tokens) duplication in the following files: Starting at line 193 of /home/tom/tmp/evo/evolution-1.5/addressbook/gui/widgets/eab-contact-display.c Starting at line 319 of /home/tom/tmp/evo/evolution-1.5/addressbook/gui/widgets/eab-contact-display.c ===================================================================== Found a 12 line (101 tokens) duplication in the following files: Starting at line 173 of /home/tom/tmp/evo/evolution-1.5/camel/providers/local/camel-mh-summary.c Starting at line 462 of /home/tom/tmp/evo/evolution-1.5/camel/providers/local/camel-maildir-summary.c fd = open(filename, O_RDONLY); if (fd == -1) { g_warning ("Cannot summarise/index: %s: %s", filename, strerror (errno)); g_free(filename); return -1; } mp = camel_mime_parser_new(); camel_mime_parser_scan_from(mp, FALSE); camel_mime_parser_init_with_fd(mp, fd); if (cls->index && (forceindex || !camel_index_has_name(cls->index, name))) { d(printf("forcing indexing of message content\n")); ===================================================================== Found a 20 line (101 tokens) duplication in the following files: Starting at line 142 of /home/tom/tmp/evo/evolution-1.5/mail/em-junk-filter.c Starting at line 564 of /home/tom/tmp/evo/evolution-1.5/camel/camel-filter-search.c if (result == -1 && errno == EINTR) { /* child process is hanging... */ kill (pid, SIGTERM); sleep (1); result = waitpid (pid, &status, WNOHANG); if (result == 0) { /* ...still hanging, set phasers to KILL */ kill (pid, SIGKILL); sleep (1); result = waitpid (pid, &status, WNOHANG); } } if (result != -1 && WIFEXITED (status)) return WEXITSTATUS (status); else return -1; } ===================================================================== Found a 19 line (101 tokens) duplication in the following files: Starting at line 1523 of /home/tom/tmp/evo/evolution-1.5/addressbook/gui/widgets/e-addressbook-view.c Starting at line 1365 of /home/tom/tmp/evo/evolution-1.5/addressbook/gui/widgets/e-addressbook-view.c while (e_printable_data_left(printable)) { if (gnome_print_gsave(pc) == -1) /* FIXME */; if (gnome_print_translate(pc, 72, 72) == -1) /* FIXME */; e_printable_print_page(printable, pc, 6.5 * 72, 9 * 72, TRUE); if (gnome_print_grestore(pc) == -1) /* FIXME */; if (gnome_print_showpage(pc) == -1) /* FIXME */; } gnome_print_job_close(master); preview = GTK_WIDGET(gnome_print_job_preview_new(master, "Print Preview")); gtk_widget_show_all(preview); g_object_unref (master); ===================================================================== Found a 19 line (101 tokens) duplication in the following files: Starting at line 1379 of /home/tom/tmp/evo/evolution-1.5/camel/providers/smtp/camel-smtp-transport.c Starting at line 1147 of /home/tom/tmp/evo/evolution-1.5/camel/providers/smtp/camel-smtp-transport.c g_strerror (errno)); camel_object_unref (transport->istream); transport->istream = NULL; camel_object_unref (transport->ostream); transport->ostream = NULL; return FALSE; } g_free (cmdbuf); do { /* Check for "250 Sender OK..." */ g_free (respbuf); respbuf = camel_stream_buffer_read_line (CAMEL_STREAM_BUFFER (transport->istream)); d(fprintf (stderr, "received: %s\n", respbuf ? respbuf : "(null)")); if (!respbuf || strncmp (respbuf, "250", 3)) { ===================================================================== Found a 25 line (100 tokens) duplication in the following files: Starting at line 864 of /home/tom/tmp/evo/evolution-1.5/mail/mail-send-recv.c Starting at line 698 of /home/tom/tmp/evo/evolution-1.5/mail/mail-send-recv.c switch(info->type) { case SEND_RECEIVE: mail_fetch_mail(info->uri, info->keep, FILTER_SOURCE_INCOMING, info->cancel, receive_get_folder, info, receive_status, info, receive_done, info); break; case SEND_SEND: /* todo, store the folder in info? */ mail_send_queue(outbox_folder, info->uri, FILTER_SOURCE_OUTGOING, info->cancel, receive_get_folder, info, receive_status, info, receive_done, info); break; case SEND_UPDATE: mail_get_store(info->uri, info->cancel, receive_update_got_store, info); break; default: g_assert_not_reached (); } ===================================================================== Found a 4 line (100 tokens) duplication in the following files: Starting at line 46 of /home/tom/tmp/evo/evolution-1.5/camel/providers/imapp/camel-imapp-utils.c Starting at line 46 of /home/tom/tmp/evo/evolution-1.5/camel/providers/imapp/camel-imapp-utils.c 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, ===================================================================== Found a 21 line (100 tokens) duplication in the following files: Starting at line 490 of /home/tom/tmp/evo/evolution-1.5/camel/providers/local/camel-mbox-store.c Starting at line 410 of /home/tom/tmp/evo/evolution-1.5/camel/providers/local/camel-spool-store.c static guint inode_hash(const void *d) { const struct _inode *v = d; return v->inode ^ v->dnode; } static gboolean inode_equal(const void *a, const void *b) { const struct _inode *v1 = a, *v2 = b; return v1->inode == v2->inode && v1->dnode == v2->dnode; } static void inode_free(void *k, void *v, void *d) { g_free(k); } static CamelFolderInfo * ===================================================================== Found a 20 line (100 tokens) duplication in the following files: Starting at line 323 of /home/tom/tmp/evo/evolution-1.5/addressbook/gui/widgets/e-addressbook-table-adapter.c Starting at line 466 of /home/tom/tmp/evo/evolution-1.5/addressbook/gui/widgets/e-addressbook-reflow-adapter.c That took 20664 milliseconds