Index: src/org/openstreetmap/josm/actions/search/SearchAction.java
===================================================================
--- src/org/openstreetmap/josm/actions/search/SearchAction.java	(revision 2225)
+++ src/org/openstreetmap/josm/actions/search/SearchAction.java	(working copy)
@@ -28,8 +28,9 @@
 
 public class SearchAction extends JosmAction{
 
-    public static final int SEARCH_HISTORY_SIZE = 10;
+    public static final int DEFAULT_SEARCH_HISTORY_SIZE = 10;
 
+
     public static enum SearchMode {
         replace, add, remove, in_selection
     }
@@ -157,9 +158,9 @@
      */
     public static void searchWithHistory(SearchSetting s) {
         if(searchHistory.isEmpty() || !s.equals(searchHistory.getFirst())) {
-            searchHistory.addFirst(s);
+            searchHistory.addFirst(new SearchSetting(s));
         }
-        while (searchHistory.size() > SEARCH_HISTORY_SIZE) {
+        while (searchHistory.size() > Main.pref.getInteger("search.history-size", DEFAULT_SEARCH_HISTORY_SIZE)) {
             searchHistory.removeLast();
         }
         lastSearch = s;
@@ -279,6 +280,14 @@
             this.text = text;
         }
 
+        public SearchSetting(SearchSetting original) {
+            super();
+            this.caseSensitive = original.caseSensitive;
+            this.regexSearch = original.regexSearch;
+            this.mode = original.mode;
+            this.text = original.text;
+        }
+
         @Override
         public String toString() {
             String cs = caseSensitive ? tr("CS") : tr("CI");
