Skip to content

Commit

Permalink
fix r2 < 5.8.9 builds
Browse files Browse the repository at this point in the history
  • Loading branch information
radare committed Oct 6, 2023
1 parent 2ecf9f2 commit 0bf4b29
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions src/core_yara.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@


/* radare - LGPLv3 - Copyright 2014-2023 - pancake, jvoisin, jfrankowski */

#include <r_core.h>
#include <yara.h>

#if R2_VERSION_NUMBER <= 50809
static inline char *r_str_after(char *s, char c) {
if (s) {
char *p = strchr (s, c);
if (p) {
*p++ = 0;
return p;
}
}
return NULL;
}
#endif

// TODO: remove globals!
static R_TH_LOCAL bool initialized = false;
static R_TH_LOCAL bool print_strings = false;
Expand Down Expand Up @@ -585,12 +596,19 @@ static int cmd_yara_fini() {
}

RCorePlugin r_core_plugin_yara = {
#if R2_VERSION_NUMBER <= 50809
.name = "yara",
.desc = "YARA integration",
.license = "LGPL",
.version = "0.1.2",
#else
.meta = {
.name = "yara",
.desc = "YARA integration",
.license = "LGPL",
.version = "0.1.2",
},
#endif
.call = cmd_yara_call,
.init = cmd_yara_init,
.fini = cmd_yara_fini
Expand Down

0 comments on commit 0bf4b29

Please sign in to comment.