www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10601] New: std.path.setExtension leaves trailing dot if extension is empty

reply d-bugmail puremagic.com writes:
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



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: -------
Jul 10 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10601


hsteoh quickfur.ath.cx changed:

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



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: -------
Jul 25 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10601




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


Fix issue 10601.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 29 2013
prev sibling parent d-bugmail puremagic.com writes:
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: -------
Jul 29 2013