Date:2015-04-25 15:41:58 (5 years 3 months ago)
Author:Maarten ter Huurne
Commit:4159e6925beb9b2f2732b2ac7dce7eae9d75de0b
Message:Declare "dirp" and "dptr" pointers just before they're needed

Files: src/menu.cpp (2 diffs)

Change Details

src/menu.cpp
8181
8282#ifdef HAVE_LIBOPK
8383    {
84        struct dirent *dptr;
8584        DIR *dirp = opendir(CARD_ROOT);
8685        if (dirp) {
86            struct dirent *dptr;
8787            while ((dptr = readdir(dirp))) {
8888                if (dptr->d_type != DT_DIR)
8989                    continue;
...... 
108108
109109void Menu::readSections(std::string const& parentDir)
110110{
111    DIR *dirp;
112    struct dirent *dptr;
113
114    dirp = opendir(parentDir.c_str());
111    DIR *dirp = opendir(parentDir.c_str());
115112    if (!dirp) return;
116113
114    struct dirent *dptr;
117115    while ((dptr = readdir(dirp))) {
118116        if (dptr->d_name[0] != '.' && dptr->d_type == DT_DIR) {
119117            // Create section if it doesn't exist yet.

Archive Download the corresponding diff file



interactive