@@ -528,6 +528,9 @@ void dstr_replace(struct dstr *str, const char *find,
size_t find_len, replace_len;
char *temp;
+ if (dstr_isempty(str))
+ return;
+
if (!replace)
replace = "";