Thread overview
[Issue 10601] New: std.path.setExtension leaves trailing dot if extension is empty
July 10, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10601

           Summary: std.path.setExtension leaves trailing dot if extension
                    is empty
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody@puremagic.com
        ReportedBy: hsteoh@quickfur.ath.cx


--- Comment #0 from hsteoh@quickfur.ath.cx 2013-07-10 16:42:01 PDT ---
Code:
-----snip-----
import std.path, std.stdio;
void main() {
    version(Windows)
        string ext = ".exe";
    version(Posix)
        string ext = "";
    string srcfile = "program.d";
    writeln(setExtension(srcfile, ext));
}
-----snip-----

Output on Posix is "program." (with the stray trailing dot). When an empty extension is given, setExtension should simply strip the extension.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
July 25, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10601


hsteoh@quickfur.ath.cx changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull


--- Comment #1 from hsteoh@quickfur.ath.cx 2013-07-25 15:25:13 PDT ---
https://github.com/D-Programming-Language/phobos/pull/1409

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
July 29, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10601



--- Comment #2 from github-bugzilla@puremagic.com 2013-07-29 08:30:58 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/e43433f56682e8964596fbff5a9ea8b1fc32f927 Fix issue 10601.

If extension is empty, std.path.setExtension should be equivalent to std.path.stripExtension. This special case is useful in generic code that needs to alternate between, e.g., .exe on Windows and no executable extension on Posix.

https://github.com/D-Programming-Language/phobos/commit/f2bd29cb97033ae041ebfd32690f01ddb25b98b7 Merge pull request #1409 from quickfur/issue10601

Fix issue 10601.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
July 29, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10601


Lars T. Kyllingstad <bugzilla@kyllingen.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla@kyllingen.net
         Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------