Module Name: othersrc
Committed By: agc
Date: Tue Oct 12 04:12:30 UTC 2021
Modified Files:
othersrc/external/bsd/bufgap/dist: gap.c gap.h
Log Message:
Add buffer gap accessor to return the complete text of the buffer as a string
Bump version number
To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 othersrc/external/bsd/bufgap/dist/gap.c
cvs rdiff -u -r1.2 -r1.3 othersrc/external/bsd/bufgap/dist/gap.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: othersrc/external/bsd/bufgap/dist/gap.c
diff -u othersrc/external/bsd/bufgap/dist/gap.c:1.1 othersrc/external/bsd/bufgap/dist/gap.c:1.2
--- othersrc/external/bsd/bufgap/dist/gap.c:1.1 Thu Sep 30 22:01:03 2021
+++ othersrc/external/bsd/bufgap/dist/gap.c Tue Oct 12 04:12:30 2021
@@ -805,6 +805,16 @@ gap_exec_string(gap_t *gap, const char *
*n = cc;
}
return s;
+ case /* "text?" */ 0x10eee6dd:
+ cc = gap->lhsc + gap->rhsc;
+ s = calloc(1, cc + 1);
+ memcpy(s, gap->v, gap->lhsc);
+ memcpy(&s[gap->lhsc], &gap->v[rhssub(gap->size, gap->rhsc)], gap->rhsc);
+ s[cc] = 0x0;
+ if (n != NULL) {
+ *n = cc;
+ }
+ return s;
}
return NULL;
}
Index: othersrc/external/bsd/bufgap/dist/gap.h
diff -u othersrc/external/bsd/bufgap/dist/gap.h:1.2 othersrc/external/bsd/bufgap/dist/gap.h:1.3
--- othersrc/external/bsd/bufgap/dist/gap.h:1.2 Thu Sep 30 22:16:57 2021
+++ othersrc/external/bsd/bufgap/dist/gap.h Tue Oct 12 04:12:30 2021
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef GAP_H_
-#define GAP_H_ 20210930
+#define GAP_H_ 20211011
#include <inttypes.h>