Details
-
Type:
Defect
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Completed
-
Affects Version/s: None
-
Fix Version/s: Approved Backlog
-
Component/s: None
-
Labels:None
-
Patch:Code and Test
-
Approval:Vetted
Description
Originally reported by Takahiro Hozumi
With a function as the "replacement" argument, clojure.string/replace-first returns nil if there is no match, instead of returning the original string unchanged.
user=> (use 'clojure.string) nil user=> (replace-first "abcdef" "ghi" "jkl") "abcdef" user=> (replace-first "abcdef" #"ghi" "jkl") "abcdef" user=> (replace-first "abcdef" #"ghi" (fn [a] "jkl")) nil
Attachments
Activity
Federico Brubacher
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Attachment | 0001-clojure.string-replace-first-now-returns-the-origina.patch [ 10157 ] |
Chris Perkins
made changes -
| Attachment | clojure-string-with-no-match-returns-original.patch [ 10720 ] |
Chris Perkins
made changes -
| Attachment | clojure-string-with-no-match-returns-original-2.patch [ 10721 ] |
Stuart Sierra
made changes -
| Patch | Code and Test [ 10002 ] | |
| Approval | Vetted [ 10003 ] | |
| Affects Version/s | Backlog [ 10035 ] | |
| Fix Version/s | Backlog [ 10035 ] | |
| Fix Version/s | Approved Backlog [ 10034 ] |
Fogus
made changes -
| Assignee | Stuart Sierra [ stuart.sierra ] | Fogus [ fogus ] |
Fogus
made changes -
| Assignee | Fogus [ fogus ] | Stuart Sierra [ stuart.sierra ] |
Stuart Sierra
made changes -
| Resolution | Completed [ 1 ] | |
| Status | Open [ 1 ] | Resolved [ 5 ] |
Stuart Halloway
made changes -
| Status | Resolved [ 5 ] | Closed [ 6 ] |
This is my patch for this issue. I have a CA signed. Any suggestions and i can try again. Federico