~medibuntu-maintainers/mplayer/medibuntu.precise

« back to all changes in this revision

Viewing changes to .pc/50_Hurd_PATH_MAX.patch/libmenu/menu_filesel.c

  • Committer: Gauvain Pocentek
  • Date: 2012-03-06 11:59:12 UTC
  • mfrom: (66.1.15 precise)
  • Revision ID: gauvain@pocentek.net-20120306115912-h9d6kt9j0l532oo5
* Merge from Ubuntu:
  - put back faac support
  - recommends apport-hooks-medibuntu
  - change Maintainer, Uploaders & Vcs-* fields.
* New upstream snapshot
* upload to unstable
* Build against external libmpeg2
* drop 51_FTBFS_arm.patch again
* no longer build depend on libcdparanoia-dev on the Hurd
* Fix FTBFS on the hurd.
  Thanks to Samuel Thibault <sthibault@debian.org> (Closes: #654974)
* Fix FTBFS on arm
* New upstream snapshot, Closes: #650339, #643621, #481807
* Imported Upstream version 1.0~rc4+svn34492
* Bump standards version
* Bump dependency on libav >= 4:0.8~, Closes: #653887
* Fix build-indep
* Build mplayer-gui again, Closes: #568514
* Drop debian/all-lang-config-mak.sh, no longer needed
* include .dfsg1 in version number
* remove get-orig-source target
* no longer prune compiler flags from the environment
* No longer advertise nor build 3fdx, mga and dxr3 backends,
  Closes: #496106, #442181, #533546
* beautify mplayer version identification string
* Brown paperbag upload.
* Next try to fix build failure on sparce after recent binutils change.
* Brown paperbag upload.
* Really fix build failure on sparc after recent binutils change.
* Properly set Replaces/Conflicts on mplayer2{,-dbg} to avoid
  file overwrite errors.
* Adjust versioning of mplayer listed in the mplayer-dbg's Depends field.
* Fix build failure on sparc after recent binutils change.
* Urgency medium bumped because of RC-level bugfix
  and speeding up x264 transition.
* Update to my @debian.org email.
* Upload to unstable
* Enable joystick support on Linux only, Closes: #638408
* Rebuild fixes toolchain issue on arm, Closes: #637077
* New upstream snapshot
* following the discussion started by Diego Biurrun <diego@biurrun.de>
  in debian-devel, I have prepared a new packaging of 'mplayer'
  (with code that comes from CVS)
* the upstream tar.bz cannot be distributed by Debian, since it contains
   CSS code; so I am repackaging it 
* I have tried my best to address all known issues:
  - the package contains the detailed Copyright made by Diego Biurrun 
  - the package does not contain CSS code, or  AFAIK other code on which 
     there is active patent enforcement
  - there is a script  debian/cvs-changelog.sh  that shows all changes
     done to files included in this source.
    This should comply with GPLv2 sec 2.a  (in spirit if not in letter)
    For this reason, the source code contains CVS directories.
* needs   make (>= 3.80) for 'html-chunked-$(1)' in DOCS/xml/Makefile

* some corrections, as suggested Diego Biurrun
  - binary codecs should go into /usr/lib/codecs (upstream default)
  - better template 'mplayer/install_codecs'
  - an empty 'font=' in mplayer.conf breaks mplayer: postinst corrected
* correction in 'mplayer/cfgnote'
* better mplayer.postinst and mplayer.config

* New upstream release
* better debian/copyright file
* do not ship a skin
* New upstream release
* changed DEB_BUILD_OPTIONS to DEB_BUILD_CONFIGURE ,
  DEB_BUILD_OPTIONS is used as in debian policy
* use gcc-3.4
* changed xlibs-dev to a long list of dependencies, for Debian/etch
* try to adhere to  http://www.mplayerhq.hu/DOCS/tech/binary-packaging.txt
  (see README.Debian for details)
* removed dependency on xlibmesa-dev, disabled opengl
* New upstream release
* Simon McVittie <hacks@pseudorandom.co.uk> wonderful work:
- Work around Debian bug #267442 (glibc's sys/uio.h and gcc's altivec.h have
  conflicting uses for __vector) by re-ordering #includes
- Fix potential symlink attack in ./configure
- Disable support for binary codecs on platforms for which those codecs
  aren't available; also disable the corresponding Debconf note when it's
  inappropriate
- Changed Build-Depends: so it works in pbuilder
- Explicitly build-depend on libjpeg62-dev, libfontconfig1-dev,
  libungif4-dev 
- Tweak debian/rules to avoid certain errors being ignored
- Use --language=all
* provide a target  'debian/rules get-orig-source' 
  that recreates the orig.tar.gz ; then use the above orig.tar.gz
* rewrote some parts of debian/rules
* don't clean and recompile docs if upstream ships them
* mplayer-doc was shipping too much stuff
* translated man pages where not installed properly
* compile with libdv4-dev
* correct README.Debian
* Forgot build-dep on libtheora
* Must not depend on libxvidcore
* New upstream release
* new release.
* rc1 to become 0.90
* new pre-release
* new pre-release
* gtk bug fixed.
* new release.
* version bumped
* 0.60 pre2 release
* 0.60 pre-release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * This file is part of MPlayer.
 
3
 *
 
4
 * MPlayer is free software; you can redistribute it and/or modify
 
5
 * it under the terms of the GNU General Public License as published by
 
6
 * the Free Software Foundation; either version 2 of the License, or
 
7
 * (at your option) any later version.
 
8
 *
 
9
 * MPlayer is distributed in the hope that it will be useful,
 
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
 * GNU General Public License for more details.
 
13
 *
 
14
 * You should have received a copy of the GNU General Public License along
 
15
 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
 
16
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
17
 */
 
18
 
 
19
#include <stdlib.h>
 
20
#include <stdio.h>
 
21
#include <dirent.h>
 
22
#include <errno.h>
 
23
#include <string.h>
 
24
#include <sys/types.h>
 
25
#include <sys/stat.h>
 
26
#include <fcntl.h>
 
27
#include <ctype.h>
 
28
#include <unistd.h>
 
29
#include <limits.h>
 
30
 
 
31
 
 
32
#include "config.h"
 
33
#include "mp_msg.h"
 
34
#include "help_mp.h"
 
35
 
 
36
#include "m_struct.h"
 
37
#include "m_option.h"
 
38
#include "mp_core.h"
 
39
#include "mplayer.h"
 
40
 
 
41
#include "libmpcodecs/img_format.h"
 
42
#include "libmpcodecs/mp_image.h"
 
43
 
 
44
#include "menu.h"
 
45
#include "menu_list.h"
 
46
#include "input/input.h"
 
47
#include "osdep/keycodes.h"
 
48
 
 
49
#define MENU_KEEP_PATH "/tmp/mp_current_path"
 
50
 
 
51
int menu_keepdir = 0;
 
52
char *menu_chroot = NULL;
 
53
 
 
54
struct list_entry_s {
 
55
  struct list_entry p;
 
56
  int d;
 
57
};
 
58
 
 
59
struct menu_priv_s {
 
60
  menu_list_priv_t p;
 
61
  char* dir; // current dir
 
62
  /// Cfg fields
 
63
  char* path;
 
64
  char* title;
 
65
  char* file_action;
 
66
  char* dir_action;
 
67
  char** actions;
 
68
  char* filter;
 
69
};
 
70
 
 
71
static struct menu_priv_s cfg_dflt = {
 
72
  MENU_LIST_PRIV_DFLT,
 
73
  NULL,
 
74
 
 
75
  NULL,
 
76
  "Select a file: %p",
 
77
  "loadfile '%p'",
 
78
  NULL,
 
79
  NULL,
 
80
  NULL
 
81
};
 
82
 
 
83
#define ST_OFF(m) M_ST_OFF(struct menu_priv_s,m)
 
84
 
 
85
static const m_option_t cfg_fields[] = {
 
86
  MENU_LIST_PRIV_FIELDS,
 
87
  { "path", ST_OFF(path),  CONF_TYPE_STRING, 0, 0, 0, NULL },
 
88
  { "title", ST_OFF(title),  CONF_TYPE_STRING, 0, 0, 0, NULL },
 
89
  { "file-action", ST_OFF(file_action),  CONF_TYPE_STRING, 0, 0, 0, NULL },
 
90
  { "dir-action", ST_OFF(dir_action),  CONF_TYPE_STRING, 0, 0, 0, NULL },
 
91
  { "actions", ST_OFF(actions), CONF_TYPE_STRING_LIST, 0, 0, 0, NULL},
 
92
  { "filter", ST_OFF(filter), CONF_TYPE_STRING, 0, 0, 0, NULL},
 
93
  { NULL, NULL, NULL, 0,0,0,NULL }
 
94
};
 
95
 
 
96
#define mpriv (menu->priv)
 
97
 
 
98
static void free_entry(list_entry_t* entry) {
 
99
  free(entry->p.txt);
 
100
  free(entry);
 
101
}
 
102
 
 
103
static char* replace_path(char* title , char* dir , int escape) {
 
104
  char *p = strstr(title,"%p");
 
105
  if(p) {
 
106
    int tl = strlen(title);
 
107
    int dl = strlen(dir);
 
108
    int t1l = p-title;
 
109
    int l = tl - 2 + dl;
 
110
    char *r, *n, *d = dir;
 
111
 
 
112
    if (escape) {
 
113
    do {
 
114
      if (*d == '\\')
 
115
        l++;
 
116
      else if (*d == '\'') /* ' -> \'\\\'\' */
 
117
        l+=7;
 
118
    } while (*d++);
 
119
    }
 
120
    r = malloc(l + 1);
 
121
    n = r + t1l;
 
122
    memcpy(r,title,t1l);
 
123
    do {
 
124
      if (escape) {
 
125
      if (*dir == '\\')
 
126
        *n++ = '\\';
 
127
      else if (*dir == '\'') { /* ' -> \'\\\'\' */
 
128
        *n++ = '\\'; *n++ = '\'';
 
129
        *n++ = '\\'; *n++ = '\\';
 
130
        *n++ = '\\'; *n++ = '\'';
 
131
        *n++ = '\\';
 
132
      }
 
133
      }
 
134
    } while ((*n++ = *dir++));
 
135
    if(tl - t1l - 2 > 0)
 
136
      strcpy(n-1,p+2);
 
137
    return r;
 
138
  } else
 
139
    return title;
 
140
}
 
141
 
 
142
typedef int (*kill_warn)(const void*, const void*);
 
143
 
 
144
static int mylstat(char *dir, char *file,struct stat* st) {
 
145
  int l = strlen(dir) + strlen(file);
 
146
  char s[l+2];
 
147
  if (!strcmp("..", file)) {
 
148
    char *slash;
 
149
    l -= 3;
 
150
    strcpy(s, dir);
 
151
#if HAVE_DOS_PATHS
 
152
    if (s[l] == '/' || s[l] == '\\')
 
153
#else
 
154
    if (s[l] == '/')
 
155
#endif
 
156
      s[l] = '\0';
 
157
    slash = strrchr(s, '/');
 
158
#if HAVE_DOS_PATHS
 
159
    if (!slash)
 
160
      slash = strrchr(s,'\\');
 
161
#endif
 
162
    if (!slash)
 
163
      return stat(dir,st);
 
164
    slash[1] = '\0';
 
165
    return stat(s,st);
 
166
  }
 
167
  sprintf(s,"%s/%s",dir,file);
 
168
  return stat(s,st);
 
169
}
 
170
 
 
171
static int compare(char **a, char **b){
 
172
  if((*a)[strlen(*a) - 1] == '/') {
 
173
    if((*b)[strlen(*b) - 1] == '/')
 
174
      return strcmp(*b, *a) ;
 
175
    else
 
176
      return 1;
 
177
  } else {
 
178
    if((*b)[strlen(*b) - 1] == '/')
 
179
      return -1;
 
180
    else
 
181
      return strcmp(*b, *a);
 
182
  }
 
183
}
 
184
 
 
185
static char **get_extensions(menu_t *menu){
 
186
  char **extensions, ext[32];
 
187
  FILE *fp;
 
188
  int n = 1;
 
189
 
 
190
  if (!mpriv->filter)
 
191
    return NULL;
 
192
 
 
193
  fp = fopen(mpriv->filter, "r");
 
194
  if(!fp)
 
195
    return NULL;
 
196
 
 
197
  extensions = malloc(sizeof(*extensions));
 
198
  *extensions = NULL;
 
199
 
 
200
  while(fgets(ext,sizeof(ext),fp)) {
 
201
    char **l, *e;
 
202
    int s = strlen (ext);
 
203
 
 
204
    if(ext[s-1] == '\n') {
 
205
      ext[s-1] = '\0';
 
206
      s--;
 
207
    }
 
208
    e = malloc(s+1);
 
209
    extensions = realloc(extensions, ++n * sizeof(*extensions));
 
210
    extensions = realloc(extensions, ++n * sizeof(*extensions));
 
211
    strcpy (e, ext);
 
212
    for (l=extensions; *l; l++);
 
213
    *l++ = e;
 
214
    *l = NULL;
 
215
  }
 
216
 
 
217
  fclose (fp);
 
218
  return extensions;
 
219
}
 
220
 
 
221
static void free_extensions(char **extensions){
 
222
  if (extensions) {
 
223
    char **l = extensions;
 
224
    while (*l)
 
225
      free (*l++);
 
226
    free (extensions);
 
227
  }
 
228
}
 
229
 
 
230
static int open_dir(menu_t* menu,char* args) {
 
231
  char **namelist, **tp;
 
232
  struct dirent *dp;
 
233
  struct stat st;
 
234
  int n;
 
235
  int path_fp;
 
236
  list_entry_t* e;
 
237
  DIR* dirp;
 
238
  char **extensions, **elem, *ext;
 
239
 
 
240
  menu_list_init(menu);
 
241
 
 
242
  free(mpriv->dir);
 
243
  mpriv->dir = strdup(args);
 
244
  if(mpriv->p.title && mpriv->p.title != mpriv->title && mpriv->p.title != cfg_dflt.p.title)
 
245
    free(mpriv->p.title);
 
246
 
 
247
  mpriv->p.title = replace_path(mpriv->title,mpriv->dir,0);
 
248
 
 
249
  if ((dirp = opendir (mpriv->dir)) == NULL){
 
250
    mp_msg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_OpendirError, strerror(errno));
 
251
    return 0;
 
252
  }
 
253
 
 
254
  if (menu_keepdir) {
 
255
    path_fp = open (MENU_KEEP_PATH, O_CREAT | O_WRONLY | O_TRUNC, 0666);
 
256
    if (path_fp >= 0) {
 
257
      write (path_fp, mpriv->dir, strlen (mpriv->dir));
 
258
      close (path_fp);
 
259
    }
 
260
  }
 
261
 
 
262
  namelist = malloc(sizeof(char *));
 
263
  extensions = get_extensions(menu);
 
264
 
 
265
  n=0;
 
266
  while ((dp = readdir(dirp)) != NULL) {
 
267
    if(dp->d_name[0] == '.' && strcmp(dp->d_name,"..") != 0)
 
268
      continue;
 
269
    if (menu_chroot && !strcmp (dp->d_name,"..")) {
 
270
      size_t len = strlen (menu_chroot);
 
271
      if ((strlen (mpriv->dir) == len || strlen (mpriv->dir) == len + 1)
 
272
          && !strncmp (mpriv->dir, menu_chroot, len))
 
273
        continue;
 
274
    }
 
275
    if (mylstat(args,dp->d_name,&st))
 
276
      continue;
 
277
    if (file_filter && extensions && !S_ISDIR(st.st_mode)) {
 
278
      if((ext = strrchr(dp->d_name,'.')) == NULL)
 
279
        continue;
 
280
      ext++;
 
281
      elem = extensions;
 
282
      do {
 
283
        if (!strcasecmp(ext, *elem))
 
284
          break;
 
285
      } while (*++elem);
 
286
      if (*elem == NULL)
 
287
        continue;
 
288
    }
 
289
    if(n%20 == 0){ // Get some more mem
 
290
      if((tp = realloc(namelist, (n+20) * sizeof (char *)))
 
291
         == NULL) {
 
292
        mp_msg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_ReallocError, strerror(errno));
 
293
        n--;
 
294
        goto bailout;
 
295
      }
 
296
      namelist=tp;
 
297
    }
 
298
 
 
299
    namelist[n] = malloc(strlen(dp->d_name) + 2);
 
300
    if(namelist[n] == NULL){
 
301
      mp_msg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_MallocError, strerror(errno));
 
302
      n--;
 
303
      goto bailout;
 
304
    }
 
305
 
 
306
    strcpy(namelist[n], dp->d_name);
 
307
    if(S_ISDIR(st.st_mode))
 
308
      strcat(namelist[n], "/");
 
309
    n++;
 
310
  }
 
311
 
 
312
bailout:
 
313
  free_extensions (extensions);
 
314
  closedir(dirp);
 
315
 
 
316
  qsort(namelist, n, sizeof(char *), (kill_warn)compare);
 
317
 
 
318
  if (n < 0) {
 
319
    mp_msg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_ReaddirError,strerror(errno));
 
320
    return 0;
 
321
  }
 
322
  while(n--) {
 
323
    if((e = calloc(1,sizeof(list_entry_t))) != NULL){
 
324
    e->p.next = NULL;
 
325
    e->p.txt = strdup(namelist[n]);
 
326
    if(strchr(namelist[n], '/') != NULL)
 
327
      e->d = 1;
 
328
    menu_list_add_entry(menu,e);
 
329
    }else{
 
330
      mp_msg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_MallocError, strerror(errno));
 
331
    }
 
332
    free(namelist[n]);
 
333
  }
 
334
  free(namelist);
 
335
 
 
336
  return 1;
 
337
}
 
338
 
 
339
static char *action;
 
340
 
 
341
static void read_cmd(menu_t* menu,int cmd) {
 
342
  switch(cmd) {
 
343
  case MENU_CMD_LEFT:
 
344
    mpriv->p.current = mpriv->p.menu; // Hack : we consider that the first entry is ../
 
345
  case MENU_CMD_RIGHT:
 
346
  case MENU_CMD_OK: {
 
347
    // Directory
 
348
    if(mpriv->p.current->d && !mpriv->dir_action) {
 
349
        // Default action : open this dirctory ourself
 
350
        int l = strlen(mpriv->dir);
 
351
        char *slash =  NULL, *p = NULL;
 
352
        if(strcmp(mpriv->p.current->p.txt,"../") == 0) {
 
353
          if(l <= 1) break;
 
354
          mpriv->dir[l-1] = '\0';
 
355
          slash = strrchr(mpriv->dir,'/');
 
356
#if HAVE_DOS_PATHS
 
357
          if (!slash)
 
358
            slash = strrchr(mpriv->dir,'\\');
 
359
#endif
 
360
          if(!slash) break;
 
361
          slash[1] = '\0';
 
362
          p = strdup(mpriv->dir);
 
363
        } else {
 
364
          p = malloc(l + strlen(mpriv->p.current->p.txt) + 1);
 
365
          sprintf(p,"%s%s",mpriv->dir,mpriv->p.current->p.txt);
 
366
        }
 
367
        menu_list_uninit(menu,free_entry);
 
368
        if(!open_dir(menu,p)) {
 
369
          mp_msg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_CantOpenDirectory,p);
 
370
          menu->cl = 1;
 
371
        }
 
372
        free(p);
 
373
    } else { // File and directory dealt with action string.
 
374
      int fname_len = strlen(mpriv->dir) + strlen(mpriv->p.current->p.txt) + 1;
 
375
      char filename[fname_len];
 
376
      char *str;
 
377
      char *action = mpriv->p.current->d ? mpriv->dir_action:mpriv->file_action;
 
378
      sprintf(filename,"%s%s",mpriv->dir,mpriv->p.current->p.txt);
 
379
      str = replace_path(action, filename,1);
 
380
      mp_input_parse_and_queue_cmds(str);
 
381
      if (str != action)
 
382
        free(str);
 
383
    }
 
384
  } break;
 
385
  case MENU_CMD_ACTION: {
 
386
    int fname_len = strlen(mpriv->dir) + strlen(mpriv->p.current->p.txt) + 1;
 
387
    char filename[fname_len];
 
388
    char *str;
 
389
    sprintf(filename,"%s%s",mpriv->dir,mpriv->p.current->p.txt);
 
390
    str = replace_path(action, filename,1);
 
391
    mp_input_parse_and_queue_cmds(str);
 
392
    if(str != action)
 
393
      free(str);
 
394
  } break;
 
395
  default:
 
396
    menu_list_read_cmd(menu,cmd);
 
397
  }
 
398
}
 
399
 
 
400
static int read_key(menu_t* menu,int c){
 
401
    char **str;
 
402
    for (str=mpriv->actions; str && *str; str++)
 
403
      if (c == (*str)[0]) {
 
404
        action = &(*str)[2];
 
405
        read_cmd(menu,MENU_CMD_ACTION);
 
406
        return 1;
 
407
      }
 
408
  if (menu_dflt_read_key(menu, c))
 
409
    return 1;
 
410
  return menu_list_jump_to_key(menu, c);
 
411
}
 
412
 
 
413
static void clos(menu_t* menu) {
 
414
  menu_list_uninit(menu,free_entry);
 
415
  free(mpriv->dir);
 
416
}
 
417
 
 
418
static int open_fs(menu_t* menu, char* args) {
 
419
  char *path = mpriv->path;
 
420
  int r = 0;
 
421
  char wd[PATH_MAX+1], b[PATH_MAX+1];
 
422
  args = NULL; // Warning kill
 
423
 
 
424
  menu->draw = menu_list_draw;
 
425
  menu->read_cmd = read_cmd;
 
426
  menu->read_key = read_key;
 
427
  menu->close = clos;
 
428
 
 
429
  if (menu_keepdir) {
 
430
    if (!path || path[0] == '\0') {
 
431
      struct stat st;
 
432
      int path_fp;
 
433
 
 
434
      path_fp = open (MENU_KEEP_PATH, O_RDONLY);
 
435
      if (path_fp >= 0) {
 
436
        if (!fstat (path_fp, &st) && (st.st_size > 0)) {
 
437
          path = malloc(st.st_size+1);
 
438
          path[st.st_size] = '\0';
 
439
          if (!((read(path_fp, path, st.st_size) == st.st_size) && path[0] == '/'
 
440
              && !stat(path, &st) && S_ISDIR(st.st_mode))) {
 
441
            free(path);
 
442
            path = NULL;
 
443
          }
 
444
        }
 
445
        close (path_fp);
 
446
      }
 
447
    }
 
448
  }
 
449
 
 
450
  getcwd(wd,PATH_MAX);
 
451
  if (!path || path[0] == '\0') {
 
452
#if 0
 
453
    char *slash = NULL;
 
454
    if (filename && !strstr(filename, "://") && (path=realpath(filename, b))) {
 
455
      slash = strrchr(path, '/');
 
456
#if HAVE_DOS_PATHS
 
457
      // FIXME: Do we need and can convert all '\\' in path to '/' on win32?
 
458
      if (!slash)
 
459
        slash = strrchr(path, '\\');
 
460
#endif
 
461
    }
 
462
    if (slash)
 
463
      slash[1] = '\0';
 
464
    else
 
465
#endif
 
466
      path = wd;
 
467
  }
 
468
  if (path[0] != '/') {
 
469
    if(path[strlen(path)-1] != '/')
 
470
      snprintf(b,sizeof(b),"%s/%s/",wd,path);
 
471
    else
 
472
      snprintf(b,sizeof(b),"%s/%s",wd,path);
 
473
    path = b;
 
474
  } else if (path[strlen(path)-1]!='/') {
 
475
    sprintf(b,"%s/",path);
 
476
    path = b;
 
477
  }
 
478
  if (menu_chroot && menu_chroot[0] == '/') {
 
479
    int l = strlen(menu_chroot);
 
480
    if (l > 0 && menu_chroot[l-1] == '/')
 
481
      --l;
 
482
    if (strncmp(menu_chroot, path, l) || (path[l] != '\0' && path[l] != '/')) {
 
483
      if (menu_chroot[l] == '/')
 
484
        path = menu_chroot;
 
485
      else {
 
486
        sprintf(b,"%s/",menu_chroot);
 
487
        path = b;
 
488
      }
 
489
    }
 
490
  }
 
491
  r = open_dir(menu,path);
 
492
 
 
493
  return r;
 
494
}
 
495
 
 
496
const menu_info_t menu_info_filesel = {
 
497
  "File seletor menu",
 
498
  "filesel",
 
499
  "Albeu",
 
500
  "",
 
501
  {
 
502
    "fs_cfg",
 
503
    sizeof(struct menu_priv_s),
 
504
    &cfg_dflt,
 
505
    cfg_fields
 
506
  },
 
507
  open_fs
 
508
};