+ text_buf[text_ptr] = '\0';
+ if (elementSetName)
+ {
+ if (!strcmp (elementSetName, "B"))
+ no_lines = 4;
+ if (!strcmp (elementSetName, "M"))
+ no_lines = 20;
+ }
+ if (no_lines)
+ {
+ char *p = text_buf;
+ int i = 0;
+
+ while (++i <= no_lines && (p = strchr (p, '\n')))
+ p++;
+ if (p)
+ {
+ p[1] = '\0';
+ text_ptr = p-text_buf;
+ }
+ }