};
-void
-textclient_reshape (text_data *d,
- int pix_w, int pix_h,
- int char_w, int char_h)
-{
- d->columns = char_w;
-}
-
-
text_data *
textclient_open (Display *dpy)
{
{
int col = 0, last_col = 0;
char *last_space = 0;
+ if (! body) return;
for (char *p = body; *p; p++) {
if (*p == '\r' || *p == '\n' || *p == ' ' || *p == '\t') {
if (col > columns && last_space) {
}
+static void
+rewrap_text (char *body, int columns)
+{
+ if (! body) return;
+ for (char *p = body; *p; p++) {
+ if (*p == '\n') {
+ if (p[1] == '\n')
+ p++;
+ else
+ *p = ' ';
+ }
+ }
+ wrap_text (body, columns);
+}
+
+
+
static void
strip_backslashes (char *s)
{
return False;
}
+
+void
+textclient_reshape (text_data *d,
+ int pix_w, int pix_h,
+ int char_w, int char_h)
+{
+ d->columns = char_w;
+ rewrap_text (d->buf, d->columns);
+}
+
#endif /* USE_IPHONE -- whole file */