Skip to content
Open
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
9 changes: 8 additions & 1 deletion src/wrapper/slash_py.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#include "slash_py.h"
#include <slash/slash.h>
#include <stdlib.h>
#include <string.h>
#include "../utils.h"

#define PY_SSIZE_T_CLEAN
#include <Python.h>
Expand All @@ -26,5 +29,9 @@ PyObject * pycsh_slash_execute(PyObject * self, PyObject * args, PyObject * kwds
char hist_buf[HISTORY_SIZE];
slash_create_static(&slas, line_buf, LINE_SIZE, hist_buf, HISTORY_SIZE);

return Py_BuildValue("i", slash_execute(&slas, command));
char * cmd_cpy CLEANUP_FREE = strdup(command);

PyObject * ret = Py_BuildValue("i", slash_execute(&slas, cmd_cpy));

return ret;
}