diff options
Diffstat (limited to 'vdr_setup.c')
-rw-r--r-- | vdr_setup.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/vdr_setup.c b/vdr_setup.c index 8e281cd..2239191 100644 --- a/vdr_setup.c +++ b/vdr_setup.c @@ -25,6 +25,7 @@ mgSetup the_setup; std::string GdFindFile( std::string mp3file, std::string ToplevelDir ); +char *readline(FILE *f); // --- mgMenuSetup ----------------------------------------------------------- @@ -107,6 +108,18 @@ mgSetup::getFilename( std::string basename ) #define FINDCMD "cd '%s' && find -follow -name '%s' 2> /dev/null" +char *readline(FILE *f) +{ + static char buffer[MAXPARSEBUFFER]; + if (fgets(buffer, sizeof(buffer), f) > 0) { + int l = strlen(buffer) - 1; + if (l >= 0 && buffer[l] == '\n') + buffer[l] = 0; + return buffer; + } + return NULL; +} + std::string GdFindFile( std::string mp3file, std::string tld ) { std::string fullname = ""; |