File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed
Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -1054,13 +1054,20 @@ static void parse_gpg_output(struct signature_check *sigc)
10541054 const char * buf = sigc -> gpg_status ;
10551055 int i ;
10561056
1057+ /* Iterate over all search strings */
10571058 for (i = 0 ; i < ARRAY_SIZE (sigcheck_gpg_status ); i ++ ) {
1058- const char * found = strstr (buf , sigcheck_gpg_status [i ].check );
1059- const char * next ;
1060- if (!found )
1061- continue ;
1059+ const char * found , * next ;
1060+
1061+ if (!prefixcmp (buf , sigcheck_gpg_status [i ].check + 1 )) {
1062+ /* At the very beginning of the buffer */
1063+ found = buf + strlen (sigcheck_gpg_status [i ].check + 1 );
1064+ } else {
1065+ found = strstr (buf , sigcheck_gpg_status [i ].check );
1066+ if (!found )
1067+ continue ;
1068+ found += strlen (sigcheck_gpg_status [i ].check );
1069+ }
10621070 sigc -> result = sigcheck_gpg_status [i ].result ;
1063- found += strlen (sigcheck_gpg_status [i ].check );
10641071 sigc -> key = xmemdupz (found , 16 );
10651072 found += 17 ;
10661073 next = strchrnul (found , '\n' );
You can’t perform that action at this time.
0 commit comments