Kaydet (Commit) e2c321b2 authored tarafından Nick Treleaven's avatar Nick Treleaven

Only replace template filename matching start of word on saving.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4901 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst 3f572f72
......@@ -4,6 +4,8 @@
Fix search_find_text not returning -1 when match is out of range.
This fixes invalid memory reads and wrong template filename
wildcard replacement.
* src/search.c, src/document.c:
Only replace template filename matching start of word on saving.
2010-05-10 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
......
......@@ -93,7 +93,7 @@ GeanyFilePrefs file_prefs;
*
* Never assume that the order of document pointers is the same as the order of notebook tabs.
* Notebook tabs can be reordered. Use @c document_get_from_page(). */
GPtrArray *documents_array;
GPtrArray *documents_array = NULL;
/* an undo action, also used for redo actions */
......@@ -1504,7 +1504,7 @@ static void replace_header_filename(GeanyDocument *doc)
g_return_if_fail(doc->file_type != NULL);
if (doc->file_type->extension)
filebase = g_strconcat(GEANY_STRING_UNTITLED, "\\.\\w+", NULL);
filebase = g_strconcat("\\<", GEANY_STRING_UNTITLED, "\\.\\w+", NULL);
else
filebase = g_strdup(GEANY_STRING_UNTITLED);
......
......@@ -1647,6 +1647,10 @@ static gboolean compile_regex(regex_t *regex, const gchar *str, gint sflags)
if (~sflags & SCFIND_MATCHCASE)
rflags |= REG_ICASE;
if (sflags & (SCFIND_WHOLEWORD | SCFIND_WORDSTART))
{
g_warning("Unsupported regex flags found!");
}
err = regcomp(regex, str, rflags);
if (err != 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment