[Webkit-unassigned] [Bug 194344] [WTF] Add getting/changing current working directory to FileSystem

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Feb 6 16:42:47 PST 2019


https://bugs.webkit.org/show_bug.cgi?id=194344

--- Comment #3 from Michael Catanzaro <mcatanzaro at igalia.com> ---
Comment on attachment 361321
  --> https://bugs.webkit.org/attachment.cgi?id=361321
Add get/change current working directory functions

View in context: https://bugs.webkit.org/attachment.cgi?id=361321&action=review

> Source/WTF/wtf/FileSystem.h:191
> +WTF_EXPORT_PRIVATE bool changeCurrentWorkingDirectory(const String &);

String&

>> Source/WTF/wtf/glib/FileSystemGlib.cpp:470
>> +    return stringFromFileSystemRepresentation(g_get_current_dir());
> 
> I think this leaks the returned string. The glib docs for g_get_current_dir states "The returned string should be freed when no longer needed"

Yeah, should be:

 GUniquePtr<char> currentDir(g_get_current_dir());
 return stringFromFileSystemRepresentation(currentDir.get());

> Source/WTF/wtf/glib/FileSystemGlib.cpp:473
> +bool changeCurrentWorkingDirectory(const String &filePath)

String&

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20190207/b19bf8bd/attachment-0001.html>


More information about the webkit-unassigned mailing list