Skip to content

fix #4005 Poco::Path::getExtension()#4011

Merged
aleks-f merged 1 commit intopocoproject:develfrom
bas524:unix-getextension
May 5, 2023
Merged

fix #4005 Poco::Path::getExtension()#4011
aleks-f merged 1 commit intopocoproject:develfrom
bas524:unix-getextension

Conversation

@bas524
Copy link
Copy Markdown
Contributor

@bas524 bas524 commented Apr 17, 2023

fix #4005

if dot is a first symbol of filename or last symbol of filename then Poco::Path::getBaseName() and Poco::Path::getExtension() returns correct values

	std::string filePath1 = "/a/b/c/.notextension";
	Poco::Path path1(filePath1, Poco::Path::Style::PATH_UNIX);

	assertEqual(".notextension", path1.getBaseName());
	assertEqual("", path1.getExtension());

	std::string filePath2 = "/a/b/c/emptyextension.";
	Poco::Path path2(filePath2, Poco::Path::Style::PATH_UNIX);

	assertEqual("emptyextension", path2.getBaseName());
	assertEqual("", path2.getExtension());

@aleks-f aleks-f added this to the Release 1.12.5 milestone May 5, 2023
@aleks-f aleks-f merged commit 75b378e into pocoproject:devel May 5, 2023
aleks-f pushed a commit that referenced this pull request May 5, 2023
aleks-f pushed a commit that referenced this pull request Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

On UNIX platform, Poco::Path::getExtension() returns name of the hidden file if no extension is present.

3 participants