Mercurial > mplayer.hg
comparison libmenu/menu_filesel.c @ 26970:2eea71274bd1
Removed unused freepath variable.
Patch by Guillaume Lecerf <foxcore at gmail com>
author | ben |
---|---|
date | Fri, 06 Jun 2008 23:24:39 +0000 |
parents | 173347ab9083 |
children | 1d0ac8ff2527 |
comparison
equal
deleted
inserted
replaced
26969:861ce0bb2773 | 26970:2eea71274bd1 |
---|---|
389 menu_list_uninit(menu,free_entry); | 389 menu_list_uninit(menu,free_entry); |
390 free(mpriv->dir); | 390 free(mpriv->dir); |
391 } | 391 } |
392 | 392 |
393 static int open_fs(menu_t* menu, char* args) { | 393 static int open_fs(menu_t* menu, char* args) { |
394 char *path = mpriv->path, *freepath = NULL; | 394 char *path = mpriv->path; |
395 int r = 0; | 395 int r = 0; |
396 char wd[PATH_MAX+1], b[PATH_MAX+1]; | 396 char wd[PATH_MAX+1], b[PATH_MAX+1]; |
397 args = NULL; // Warning kill | 397 args = NULL; // Warning kill |
398 | 398 |
399 menu->draw = menu_list_draw; | 399 menu->draw = menu_list_draw; |
409 path_fp = open (MENU_KEEP_PATH, O_RDONLY); | 409 path_fp = open (MENU_KEEP_PATH, O_RDONLY); |
410 if (path_fp >= 0) { | 410 if (path_fp >= 0) { |
411 if (!fstat (path_fp, &st) && (st.st_size > 0)) { | 411 if (!fstat (path_fp, &st) && (st.st_size > 0)) { |
412 path = malloc(st.st_size+1); | 412 path = malloc(st.st_size+1); |
413 path[st.st_size] = '\0'; | 413 path[st.st_size] = '\0'; |
414 if ((read(path_fp, path, st.st_size) == st.st_size) && path[0] == '/' | 414 if (!((read(path_fp, path, st.st_size) == st.st_size) && path[0] == '/' |
415 && !stat(path, &st) && S_ISDIR(st.st_mode)) | 415 && !stat(path, &st) && S_ISDIR(st.st_mode))) { |
416 freepath = path; | |
417 else { | |
418 free(path); | 416 free(path); |
419 path = NULL; | 417 path = NULL; |
420 } | 418 } |
421 } | 419 } |
422 close (path_fp); | 420 close (path_fp); |
465 } | 463 } |
466 } | 464 } |
467 } | 465 } |
468 r = open_dir(menu,path); | 466 r = open_dir(menu,path); |
469 | 467 |
470 if (freepath) | |
471 free(freepath); | |
472 | |
473 return r; | 468 return r; |
474 } | 469 } |
475 | 470 |
476 const menu_info_t menu_info_filesel = { | 471 const menu_info_t menu_info_filesel = { |
477 "File seletor menu", | 472 "File seletor menu", |