summaryrefslogtreecommitdiffstats
path: root/libmenu/menu_filesel.c
diff options
context:
space:
mode:
Diffstat (limited to 'libmenu/menu_filesel.c')
-rw-r--r--libmenu/menu_filesel.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/libmenu/menu_filesel.c b/libmenu/menu_filesel.c
index 1321702945..08507bec20 100644
--- a/libmenu/menu_filesel.c
+++ b/libmenu/menu_filesel.c
@@ -48,7 +48,6 @@
int menu_keepdir = 0;
char *menu_chroot = NULL;
-extern char *filename;
struct list_entry_s {
struct list_entry p;
@@ -250,7 +249,7 @@ static int open_dir(menu_t* menu,char* args) {
mpriv->p.title = replace_path(mpriv->title,mpriv->dir,0);
if ((dirp = opendir (mpriv->dir)) == NULL){
- mp_msg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_OpendirError, strerror(errno));
+ mp_tmsg(MSGT_GLOBAL,MSGL_ERR,"[MENU] opendir error: %s\n", strerror(errno));
return 0;
}
@@ -292,7 +291,7 @@ static int open_dir(menu_t* menu,char* args) {
if(n%20 == 0){ // Get some more mem
if((tp = (char **) realloc(namelist, (n+20) * sizeof (char *)))
== NULL) {
- mp_msg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_ReallocError, strerror(errno));
+ mp_tmsg(MSGT_GLOBAL,MSGL_ERR,"[MENU] realloc error: %s\n", strerror(errno));
n--;
goto bailout;
}
@@ -301,7 +300,7 @@ static int open_dir(menu_t* menu,char* args) {
namelist[n] = (char *) malloc(strlen(dp->d_name) + 2);
if(namelist[n] == NULL){
- mp_msg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_MallocError, strerror(errno));
+ mp_tmsg(MSGT_GLOBAL,MSGL_ERR,"[MENU] memory allocation error: %s\n", strerror(errno));
n--;
goto bailout;
}
@@ -319,7 +318,7 @@ bailout:
qsort(namelist, n, sizeof(char *), (kill_warn)compare);
if (n < 0) {
- mp_msg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_ReaddirError,strerror(errno));
+ mp_tmsg(MSGT_GLOBAL,MSGL_ERR,"[MENU] readdir error: %s\n",strerror(errno));
return 0;
}
while(n--) {
@@ -330,7 +329,7 @@ bailout:
e->d = 1;
menu_list_add_entry(menu,e);
}else{
- mp_msg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_MallocError, strerror(errno));
+ mp_tmsg(MSGT_GLOBAL,MSGL_ERR,"[MENU] memory allocation error: %s\n", strerror(errno));
}
free(namelist[n]);
}
@@ -369,7 +368,7 @@ static void read_cmd(menu_t* menu,int cmd) {
}
menu_list_uninit(menu,free_entry);
if(!open_dir(menu,p)) {
- mp_msg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_CantOpenDirectory,p);
+ mp_tmsg(MSGT_GLOBAL,MSGL_ERR,"[MENU] Can't open directory %s.\n",p);
menu->cl = 1;
}
free(p);
@@ -380,7 +379,7 @@ static void read_cmd(menu_t* menu,int cmd) {
char *action = mpriv->p.current->d ? mpriv->dir_action:mpriv->file_action;
sprintf(filename,"%s%s",mpriv->dir,mpriv->p.current->p.txt);
str = replace_path(action, filename,1);
- mp_input_parse_and_queue_cmds(str);
+ mp_input_parse_and_queue_cmds(menu->input_ctx, str);
if (str != action)
free(str);
}
@@ -391,7 +390,7 @@ static void read_cmd(menu_t* menu,int cmd) {
char *str;
sprintf(filename,"%s%s",mpriv->dir,mpriv->p.current->p.txt);
str = replace_path(action, filename,1);
- mp_input_parse_and_queue_cmds(str);
+ mp_input_parse_and_queue_cmds(menu->input_ctx, str);
if(str != action)
free(str);
} break;