From d3ad4d559cc9619854cdb5deb6b2a0b08c793f95 Mon Sep 17 00:00:00 2001 From: maxcodehack Date: Wed, 16 Dec 2020 07:18:16 +0000 Subject: [PATCH] Fix OpenDialog in uPDF (replace'updf' with argv[0]) git-svn-id: svn://kolibrios.org@8414 a494cfbc-eb01-0410-851d-a64ba20cac60 --- contrib/media/updf_newlib/apps/kos_main.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/contrib/media/updf_newlib/apps/kos_main.c b/contrib/media/updf_newlib/apps/kos_main.c index f1f8af9b7d..ccc2616f67 100755 --- a/contrib/media/updf_newlib/apps/kos_main.c +++ b/contrib/media/updf_newlib/apps/kos_main.c @@ -107,9 +107,11 @@ void winclose(pdfapp_t *app) __menuet__sys_exit(); } -void RunOpenApp() +void RunOpenApp(char name[]) { - RunApp("/sys/lod", "*pdf* ./mupdf"); + char cmd[250] = "*pdf* "; + strcat(cmd, name); + RunApp("/sys/lod", cmd); } @@ -362,7 +364,7 @@ int main (int argc, char* argv[]) if (argc == 1) { kol_board_puts("uPDF: no param set, showing OpenDialog"); - RunOpenApp(); + RunOpenApp(argv[0]); __menuet__sys_exit(); } @@ -433,7 +435,7 @@ int main (int argc, char* argv[]) case evButton: butt = __menuet__get_button_id(); if(butt==1) __menuet__sys_exit(); - if(butt==10) RunOpenApp(); + if(butt==10) RunOpenApp(argv[0]); if(butt==11) PageZoomOut(); //magnify - if(butt==12) PageZoomIn(); //magnify + if(butt==13) //show help