Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
VideoLAN
medialibrary
Commits
7556587a
Commit
7556587a
authored
Dec 29, 2015
by
Hugo Beauzée-Luyssen
Browse files
fs: Directory: Remove superfluous heap alloc
parent
5fca29df
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/filesystem/unix/Directory.cpp
View file @
7556587a
...
...
@@ -72,15 +72,15 @@ std::shared_ptr<IDevice> Directory::device() const
std
::
string
Directory
::
toAbsolute
(
const
std
::
string
&
path
)
{
auto
abs
=
std
::
unique_ptr
<
char
[]
>
(
new
char
[
PATH_MAX
]
)
;
if
(
realpath
(
path
.
c_str
(),
abs
.
get
()
)
==
nullptr
)
char
abs
[
PATH_MAX
];
if
(
realpath
(
path
.
c_str
(),
abs
)
==
nullptr
)
{
std
::
string
err
(
"Failed to convert to absolute path"
);
err
+=
"("
+
path
+
"): "
;
err
+=
strerror
(
errno
);
throw
std
::
runtime_error
(
err
);
}
return
std
::
string
{
abs
.
get
()
};
return
std
::
string
{
abs
};
}
void
Directory
::
read
()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment