diff --git a/src/gui/update.cpp b/src/gui/update.cpp index fd9fb882f..84c2fa36f 100644 --- a/src/gui/update.cpp +++ b/src/gui/update.cpp @@ -582,9 +582,9 @@ int CFlashUpdate::exec(CMenuTarget* parent, const std::string &actionKey) showGlobalStatus(60); dprintf(DEBUG_NORMAL, "[update] flash/install filename %s type %c\n", filename.c_str(), fileType); - if (gotImage) + + if (gotImage && (fileType <= '9')) // flashing image { - //flash it... #if ENABLE_EXTUPDATE #ifndef BOXMODEL_CS_HD2 if (g_settings.apply_settings) { @@ -616,23 +616,8 @@ int CFlashUpdate::exec(CMenuTarget* parent, const std::string &actionKey) sleep(2); ft.reboot(); } - else if(fileType == 'T') // display file contents - { - FILE* fd = fopen(filename.c_str(), "r"); - if(fd) { - char * buffer; - off_t filesize = lseek(fileno(fd), 0, SEEK_END); - lseek(fileno(fd), 0, SEEK_SET); - buffer =(char *) malloc((uint32_t)filesize+1); - fread(buffer, (uint32_t)filesize, 1, fd); - fclose(fd); - buffer[filesize] = 0; - ShowMsg(LOCALE_MESSAGEBOX_INFO, buffer, CMsgBox::mbrBack, CMsgBox::mbBack); - free(buffer); - } - } #if HAVE_ARM_HARDWARE - else if (fileType == 'Z') + else if (gotImage && (fileType == 'Z')) // flashing image with ofgwrite { showGlobalStatus(100); @@ -733,6 +718,21 @@ int CFlashUpdate::exec(CMenuTarget* parent, const std::string &actionKey) return menu_return::RETURN_EXIT_ALL; } #endif + else if (fileType == 'T') // not image, display file contents + { + FILE* fd = fopen(filename.c_str(), "r"); + if(fd) { + char * buffer; + off_t filesize = lseek(fileno(fd), 0, SEEK_END); + lseek(fileno(fd), 0, SEEK_SET); + buffer = (char *) malloc((uint32_t)filesize+1); + fread(buffer, (uint32_t)filesize, 1, fd); + fclose(fd); + buffer[filesize] = 0; + ShowMsg(LOCALE_MESSAGEBOX_INFO, buffer, CMsgBox::mbrBack, CMsgBox::mbBack); + free(buffer); + } + } else // not image, install { const char install_sh[] = TARGET_PREFIX "/bin/install.sh";