diff --git a/main.c b/main.c index 8e51985..24c30ac 100644 --- a/main.c +++ b/main.c @@ -23,6 +23,7 @@ #include #include +#include int printLicense(int full){ if (full == 0) { @@ -46,10 +47,20 @@ int printLicense(int full){ void getAdditionalDirs(){ printf("%sRecolhendo pastas adicionais...\n", ANSI_COLOR_CYAN); - //FILE* adf = fopen("./adf.txt", "r"); int dirs; dirs = GetPrivateProfileInt("Pastas", "Pastas", 3, ".\\cfg\\pastas.ini"); printf("%s %d\n", STR_DIR_COUNT, dirs); + fflush(stdout); + for(unsigned short x = 0; x < dirs; x++){ + char dirKey[7] = "Pasta"; // PastaX... + //strcpy(dirKey, "Pasta"); + char* intPtr = (x + 1) + '0'; + strcat(dirKey, &intPtr); + _TCHAR currentPath[128]; + GetPrivateProfileString("Pastas", dirKey, "null", currentPath, + sizeof(currentPath) / sizeof(currentPath[0]), ".\\cfg\\pastas.ini"); + printf("%s [%s] %s\n", STR_FOUND_DIR, dirKey, currentPath); + } } void cleanLoadedDirs(){ @@ -79,6 +90,6 @@ int main(void){ return 0; getAdditionalDirs(); cleanLoadedDirs(); - printf("%s\n", ANSI_COLOR_RESET); + printf("%s", ANSI_COLOR_RESET); return 0; } \ No newline at end of file diff --git a/str.h b/str.h index 0695da5..b1b9a0b 100644 --- a/str.h +++ b/str.h @@ -28,6 +28,7 @@ #define STR_REMOVED_FILE "[Arquivo removido]" #define STR_REMOVED_DIR "[Pasta removida]" #define STR_DIR_COUNT "[Contagem de pastas]" +#define STR_FOUND_DIR "[Pasta encontrada]" #define STR_ERROR_LIC "Falha ao ler arquivo de licença. Visite para mais informações."