summaryrefslogtreecommitdiffstats
path: root/src/undo.c
diff options
context:
space:
mode:
authorAndrés <andmarti@gmail.com>2021-06-12 16:16:07 -0300
committerAndrés <andmarti@gmail.com>2021-06-12 16:16:07 -0300
commit64ab1af93f151ac6bb51c520b76916e65444646a (patch)
treeb6dd758eafa1d9683ef2eff1d702ecdc023d800f /src/undo.c
parent69f4b2d1345abe6235a776b9c1ff1e59272caa53 (diff)
Fix in paste_yanked_ents when pasting (with Pv) over same place where data was yanked
Diffstat (limited to 'src/undo.c')
-rw-r--r--src/undo.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/undo.c b/src/undo.c
index c92ed39..f378253 100644
--- a/src/undo.c
+++ b/src/undo.c
@@ -469,7 +469,7 @@ void copy_to_undostruct (struct sheet * sh, int ri, int ci, int rf, int cf, char
// and only if no destination pointer was given
struct ent_ptr * y_cells = destination == NULL ? NULL : *destination;
if (y_cells == NULL && handle_deps == HANDLE_DEPS && deps != NULL)
- y_cells = (struct ent_ptr *) calloc((rf-ri+1)*(cf-ci+1)+deps->vf, sizeof(struct ent_ptr));
+ y_cells = (struct ent_ptr *) calloc((rf-ri+1)*(cf-ci+1) + deps->vf, sizeof(struct ent_ptr));
else if (y_cells == NULL)
y_cells = (struct ent_ptr *) calloc((rf-ri+1)*(cf-ci+1), sizeof(struct ent_ptr));
@@ -492,7 +492,8 @@ void copy_to_undostruct (struct sheet * sh, int ri, int ci, int rf, int cf, char
if (ent_ptr_exists_on_list(lista, &e)) continue;
// initialize the 'ent'
- if (destination == NULL) y_cells->vp = malloc(sizeof(struct ent));
+ //if (destination == NULL) y_cells->vp = malloc(sizeof(struct ent));
+ y_cells->vp = malloc(sizeof(struct ent));
cleanent(y_cells->vp);
y_cells->sheet = sh;
@@ -522,7 +523,8 @@ void copy_to_undostruct (struct sheet * sh, int ri, int ci, int rf, int cf, char
if (p == NULL) continue;
// initialize the 'ent'
- if (destination == NULL) y_cells->vp = malloc(sizeof(struct ent));
+ //if (destination == NULL) y_cells->vp = malloc(sizeof(struct ent));
+ y_cells->vp = malloc(sizeof(struct ent));
cleanent(y_cells->vp);
y_cells->sheet = deps[i].sheet;