diff options
| author | Werner Koch <[email protected]> | 2019-07-12 11:57:00 +0000 |
|---|---|---|
| committer | Werner Koch <[email protected]> | 2019-07-12 11:57:00 +0000 |
| commit | a5118b19c182b558635a6a11ef55b6b8a18c04e9 (patch) | |
| tree | 16f59401d004b086e1a00c7dad8e4a7523af2fae /g10/photoid.c | |
| parent | Merge branch 'master' into switch-to-gpgk (diff) | |
| parent | scd: Remove useless GNUPG_SCD_MAIN_HEADER macro. (diff) | |
| download | gnupg-a5118b19c182b558635a6a11ef55b6b8a18c04e9.tar.gz gnupg-a5118b19c182b558635a6a11ef55b6b8a18c04e9.zip | |
Merge branch 'master' into switch-to-gpgk
Diffstat (limited to 'g10/photoid.c')
| -rw-r--r-- | g10/photoid.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/g10/photoid.c b/g10/photoid.c index bcea64fbf..f9720d329 100644 --- a/g10/photoid.c +++ b/g10/photoid.c @@ -262,7 +262,8 @@ char *image_type_to_string(byte type,int style) } #if !defined(FIXED_PHOTO_VIEWER) && !defined(DISABLE_PHOTO_VIEWER) -static const char *get_default_photo_command(void) +static const char * +get_default_photo_command(void) { #if defined(_WIN32) OSVERSIONINFO osvi; @@ -274,14 +275,21 @@ static const char *get_default_photo_command(void) if(osvi.dwPlatformId==VER_PLATFORM_WIN32_WINDOWS) return "start /w %i"; else - return "cmd /c start /w %i"; + return "!ShellExecute 400 %i"; #elif defined(__APPLE__) /* OS X. This really needs more than just __APPLE__. */ return "open %I"; #elif defined(__riscos__) return "Filer_Run %I"; #else - return "xloadimage -fork -quiet -title 'KeyID 0x%k' stdin"; + if (!path_access ("xloadimage", X_OK)) + return "xloadimage -fork -quiet -title 'KeyID 0x%k' stdin"; + else if (!path_access ("display",X_OK)) + return "display -title 'KeyID 0x%k' %i"; + else if (getuid () && !path_access ("xdg-open", X_OK)) + return "xdg-open %i"; + else + return "/bin/true"; #endif } #endif @@ -312,6 +320,8 @@ show_photos (ctrl_t ctrl, const struct user_attribute *attrs, int count, if (pk) keyid_from_pk (pk, kid); + es_fflush (es_stdout); + for(i=0;i<count;i++) if(attrs[i].type==ATTRIB_IMAGE && parse_image_header(&attrs[i],&args.imagetype,&len)) |
