diff -Nur a/src/find.c b/src/find.c
a
|
b
|
|
56 | 56 | static int FIND2_X = 64; |
57 | 57 | #define FIND2_X_USE (FIND2_X - 20) |
58 | 58 | |
| 59 | /* Separator for file line view in search */ |
| 60 | #define SEPARATOR " -//- " |
| 61 | |
59 | 62 | /* A couple of extra messages we need */ |
60 | 63 | enum { |
61 | 64 | B_STOP = B_USER + 1, |
… |
… |
|
559 | 562 | if (found == 0){ /* Search in binary line once */ |
560 | 563 | if (find_regex_flag) { |
561 | 564 | if (regexec (r, p, 1, 0, 0) == 0){ |
562 | | g_free (p); |
563 | | p = g_strdup_printf ("%d:%s", line, filename); |
564 | | find_add_match (h, directory, p); |
| 565 | char *p2 = g_strdup_printf ("%d:%s%s%s", line, filename, SEPARATOR, p); |
| 566 | find_add_match (h, directory, p2); |
| 567 | g_free (p2); |
565 | 568 | found = 1; |
566 | 569 | } |
567 | 570 | } else { |
… |
… |
|
747 | 750 | static char * |
748 | 751 | make_fullname (const char *dirname, const char *filename) |
749 | 752 | { |
750 | | |
| 753 | char *dirty_name, *clean_name, *separator_start; |
| 754 | |
751 | 755 | if (strcmp(dirname, ".") == 0 || strcmp(dirname, "."PATH_SEP_STR) == 0) |
752 | | return g_strdup (filename); |
753 | | if (strncmp(dirname, "."PATH_SEP_STR, 2) == 0) |
754 | | return concat_dir_and_file (dirname + 2, filename); |
755 | | return concat_dir_and_file (dirname, filename); |
| 756 | dirty_name = g_strdup (filename); |
| 757 | else if (strncmp(dirname, "."PATH_SEP_STR, 2) == 0) |
| 758 | dirty_name = concat_dir_and_file (dirname + 2, filename); |
| 759 | else |
| 760 | dirty_name = concat_dir_and_file (dirname, filename); |
| 761 | |
| 762 | /* If the separator is in the name remove it */ |
| 763 | if ((separator_start = strstr (dirty_name, SEPARATOR))) |
| 764 | clean_name = g_strndup (dirty_name, separator_start - dirty_name); |
| 765 | else |
| 766 | return dirty_name; |
| 767 | |
| 768 | g_free (dirty_name); |
| 769 | |
| 770 | return (clean_name); |
756 | 771 | } |
757 | 772 | |
758 | 773 | static void |