diff options
Diffstat (limited to 'mplayer.c')
-rw-r--r-- | mplayer.c | 25 |
1 files changed, 3 insertions, 22 deletions
@@ -1013,7 +1013,7 @@ static void load_per_file_config (m_config_t* conf, const char *const file) { char *confpath; char cfg[PATH_MAX]; - char *name; + const char *name; if (strlen(file) > PATH_MAX - 14) { mp_msg(MSGT_CPLAYER, MSGL_WARN, "Filename is too long, can not load file or directory specific config files\n"); @@ -1021,20 +1021,7 @@ static void load_per_file_config (m_config_t* conf, const char *const file) } sprintf (cfg, "%s.conf", file); - name = strrchr(cfg, '/'); - if (HAVE_DOS_PATHS) { - char *tmp = strrchr(cfg, '\\'); - if (!name || tmp > name) - name = tmp; - tmp = strrchr(cfg, ':'); - if (!name || tmp > name) - name = tmp; - } - if (!name) - name = cfg; - else - name++; - + name = mp_basename(cfg); if (use_filedir_conf) { char dircfg[PATH_MAX]; strcpy(dircfg, cfg); @@ -3695,14 +3682,8 @@ if (edl_output_filename) { vo_vobsub=vobsub_open(buf,spudec_ifo,0,&vo_spudec); /* try from ~/.mplayer/sub */ if(!vo_vobsub && (psub = get_path( "sub/" ))) { - char *bname; + const char *bname = mp_basename(buf); int l; - bname = strrchr(buf,'/'); -#if defined(__MINGW32__) || defined(__CYGWIN__) - if(!bname) bname = strrchr(buf,'\\'); -#endif - if(bname) bname++; - else bname = buf; l = strlen(psub) + strlen(bname) + 1; psub = realloc(psub,l); strcat(psub,bname); |