Use recorded last path only when stat it ok.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25327 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
ulion 2007-12-09 07:50:37 +00:00
parent 6e9b19642a
commit af43903635
1 changed files with 2 additions and 1 deletions

View File

@ -413,7 +413,8 @@ static int open_fs(menu_t* menu, char* args) {
if (path_fp >= 0) {
if (!fstat (path_fp, &st) && (st.st_size > 0)) {
path = malloc(st.st_size+1);
if ((read(path_fp, path, st.st_size) == st.st_size) && path[0] != '\0'){
if ((read(path_fp, path, st.st_size) == st.st_size) && path[0] == '/'
&& !stat(path, &st) && S_ISDIR(st.st_mode)){
freepath = path;
path[st.st_size] = '\0';
}