nvi-29-file_backup.patch (1000B)
1 #! /bin/sh /usr/share/dpatch/dpatch-run 2 ## 29file_backup.dpatch by <hesso@pool.math.tu-berlin.de> 3 ## 4 ## DP: Save the intermediate CHAR2INT conversion pointer because 5 ## DP: that pointer is reused by later conversions in calls below. 6 7 @DPATCH@ 8 --- nvi-1.81.6.orig/common/exf.c 2009-07-24 11:30:05.962060755 +0200 9 +++ nvi-1.81.6/common/exf.c 2009-07-24 12:09:57.511311177 +0200 10 @@ -1092,8 +1092,8 @@ 11 size_t blen; 12 int flags, maxnum, nr, num, nw, rfd, wfd, version; 13 char *bp, *estr, *p, *pct, *slash, *t, *wfname, buf[8192]; 14 - CHAR_T *wp; 15 - size_t wlen; 16 + CHAR_T *wp, *wp2; 17 + size_t wlen, wlen2; 18 size_t nlen; 19 char *d = NULL; 20 21 @@ -1148,8 +1148,13 @@ 22 } else 23 version = 0; 24 CHAR2INT(sp, bname, strlen(bname) + 1, wp, wlen); 25 - if (argv_exp2(sp, &cmd, wp, wlen - 1)) 26 + GET_SPACE_RETW(sp, wp2, wlen2, wlen); 27 + MEMCPY(wp2, wp, wlen); 28 + if (argv_exp2(sp, &cmd, wp2, wlen2 - 1)) { 29 + FREE_SPACEW(sp, wp2, wlen2); 30 return (1); 31 + } 32 + FREE_SPACEW(sp, wp2, wlen2); 33 34 /* 35 * 0 args: impossible.