Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions patches/libedit-ignore-missing-cookie.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
diff --git a/src/history.c b/src/history.c
index 2a8ca1a..71b3fbe 100644
--- a/src/history.c
+++ b/src/history.c
@@ -793,13 +793,12 @@ history_load(TYPE(History) *h, const char *fname)
if ((sz = getline(&line, &llen, fp)) == -1)
goto done;

- if (strncmp(line, hist_cookie, (size_t)sz) != 0)
- goto done;
-
ptr = h_malloc((max_size = 1024) * sizeof(*ptr));
if (ptr == NULL)
goto done;
- for (i = 0; (sz = getline(&line, &llen, fp)) != -1; i++) {
+ for (i = 0; (sz = getline(&line, &llen, fp)) != -1;) {
+ if (i == 0 && strncmp(line, hist_cookie, (size_t)sz) != 0)
+ continue;
if (sz > 0 && line[sz - 1] == '\n')
line[--sz] = '\0';
if (max_size < (size_t)sz) {
@@ -820,6 +819,7 @@ history_load(TYPE(History) *h, const char *fname)
i = -1;
goto oomem;
}
+ i++;
}
oomem:
h_free(ptr);
1 change: 1 addition & 0 deletions python/build_definitions/libedit.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def __init__(self) -> None:
url_pattern='https://github.com/yugabyte/libedit/archive/libedit-{}.tar.gz',
build_group=BuildGroup.POTENTIALLY_INSTRUMENTED)
self.copy_sources = True
self.patches = ['libedit-ignore-missing-cookie.patch']

def get_additional_compiler_flags(self, builder: BuilderInterface) -> List[str]:
flags = ['-I%s' % os.path.join(builder.prefix_include, 'ncurses')]
Expand Down
Loading