fixed a thing i forgot to fix the other day

This commit is contained in:
david committed 2026-07-05 14:19:31 -03:00
1 parent 7fd45cc252
commit 94a5c2c299
3 files changed
+11 -6

No files matched your search

+11 -6
View File
@@ -154,9 +154,14 @@ int main(int argc, char **argv){
sdlcleanup(&displayerer, images, dir, count, EXIT_FAILURE); sdlcleanup(&displayerer, images, dir, count, EXIT_FAILURE);
} }
mkdir("../saved", 0755); char saveddir[1024], otherdir[1024], deletedir[1024];
mkdir("../other", 0755); snprintf(saveddir, sizeof(saveddir), "%s/saved", path);
mkdir("../delete", 0755); snprintf(otherdir, sizeof(otherdir), "%s/other", path);
snprintf(deletedir, sizeof(deletedir), "%s/delete", path);
mkdir(saveddir, 0755);
mkdir(otherdir, 0755);
mkdir(deletedir, 0755);
if(sdlinit(&displayerer)){ if(sdlinit(&displayerer)){
sdlcleanup(&displayerer, images, dir, count, EXIT_FAILURE); sdlcleanup(&displayerer, images, dir, count, EXIT_FAILURE);
@@ -208,7 +213,7 @@ int main(int argc, char **argv){
SDL_StopTextInput(); SDL_StopTextInput();
char *ext = strrchr(images[whichone], '.'); char *ext = strrchr(images[whichone], '.');
char savedbuf[1024]; char savedbuf[1024];
snprintf(savedbuf, sizeof(savedbuf), "../saved/%s%s", textbuf, ext ? ext : ""); snprintf(savedbuf, sizeof(savedbuf), "%s/%s%s", saveddir, textbuf, ext ? ext : "");
rename(images[whichone], savedbuf); rename(images[whichone], savedbuf);
if(whichone + 1 < count){ if(whichone + 1 < count){
whichone++; whichone++;
@@ -237,7 +242,7 @@ int main(int argc, char **argv){
case SDL_SCANCODE_S: case SDL_SCANCODE_S:
if(!typing){ if(!typing){
char otherbuf[1024]; char otherbuf[1024];
snprintf(otherbuf, sizeof(otherbuf), "../other/%s", strrchr(images[whichone], '/') + 1); snprintf(otherbuf, sizeof(otherbuf), "%s/%s", otherdir, strrchr(images[whichone], '/') + 1);
rename(images[whichone], otherbuf); rename(images[whichone], otherbuf);
if(whichone + 1 < count){ if(whichone + 1 < count){
whichone++; whichone++;
@@ -249,7 +254,7 @@ int main(int argc, char **argv){
case SDL_SCANCODE_D: case SDL_SCANCODE_D:
if(!typing){ if(!typing){
char otherbuf[1024]; char otherbuf[1024];
snprintf(otherbuf, sizeof(otherbuf), "../delete/%s", strrchr(images[whichone], '/') + 1); snprintf(otherbuf, sizeof(otherbuf), "%s/%s", deletedir, strrchr(images[whichone], '/') + 1);
rename(images[whichone], otherbuf); rename(images[whichone], otherbuf);
if(whichone + 1 < count){ if(whichone + 1 < count){
whichone++; whichone++;
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 460 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB