Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 157187 Details for
Bug 244182
empty lines are shown
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
PATCH fixing the crlf issues
gtkterm-0.99.5-crlf.patch (text/plain), 4.44 KB, created by
Hans de Goede
on 2007-06-16 11:00:18 UTC
(
hide
)
Description:
PATCH fixing the crlf issues
Filename:
MIME Type:
Creator:
Hans de Goede
Created:
2007-06-16 11:00:18 UTC
Size:
4.44 KB
patch
obsolete
>--- gtkterm-0.99.5/src/buffer.c.crlf 2005-09-22 21:33:44.000000000 +0200 >+++ gtkterm-0.99.5/src/buffer.c 2007-06-16 13:10:41.000000000 +0200 >@@ -23,11 +23,12 @@ > #include "buffer.h" > #include "gettext.h" > #include "i18n.h" >+#include "serie.h" > > static char *buffer = NULL; > static char *current_buffer; > static unsigned int pointer; >- >+static int cr_received = 0; > char overlapped; > > void (*write_func)(char *, unsigned int) = NULL; >@@ -54,39 +55,56 @@ > { > char *characters; > >- int pos; >- GString *buffer_tmp; >- gchar *in_buffer; >- >- buffer_tmp = g_string_new(chars); >- > /* If the auto CR LF mode on, read the buffer to add \r before \n */ > > if(crlf_auto) > { >- in_buffer=buffer_tmp->str; >+ /* BUFFER_RECEPTION*2 for worst case scenario, all \n or \r chars */ >+ char out_buffer[BUFFER_RECEPTION*2]; >+ int i, out_size; > >- in_buffer += size; >- for(pos=size; pos>0; pos--) >- { >- in_buffer--; >- >- if(*in_buffer=='\n' && *(in_buffer-1) != '\r') >- { >- g_string_insert_c(buffer_tmp, pos-1, '\r'); >- size += 1; >- } >- >- if(*in_buffer=='\r' && *(in_buffer+1) != '\n') >- { >- g_string_insert_c(buffer_tmp, pos, '\n'); >- size += 1; >- } >- } >+ for (i=0; i<size; i++) >+ { >+ if (chars[i] == '\r') >+ { >+ /* If the previous character was a CR too, insert a newline */ >+ if (cr_received) >+ { >+ out_buffer[out_size] = '\n'; >+ out_size++; >+ } >+ cr_received = 1; >+ } >+ else >+ { >+ if (chars[i] == '\n') >+ { >+ /* If we get a newline without a CR first, insert a CR */ >+ if (!cr_received) >+ { >+ out_buffer[out_size] = '\r'; >+ out_size++; >+ } >+ } >+ else >+ { >+ /* If we receive a normal char, and the previous one was a >+ CR insert a newline */ >+ if (cr_received) >+ { >+ out_buffer[out_size] = '\n'; >+ out_size++; >+ } >+ } >+ cr_received = 0; >+ } >+ out_buffer[out_size] = chars[i]; >+ out_size++; >+ } >+ chars = out_buffer; >+ size = out_size; > } > >- chars = buffer_tmp->str; >- > if(buffer == NULL) > { > i18n_printf(_("ERROR : Buffer is not initialized !\n")); >@@ -157,6 +175,7 @@ > memset(buffer, 0, BUFFER_SIZE); > current_buffer = buffer; > pointer = 0; >+ cr_received = 0; > } > > void set_clear_func(void (*func)(void)) >--- gtkterm-0.99.5/src/widgets.c.crlf 2005-09-22 22:13:00.000000000 +0200 >+++ gtkterm-0.99.5/src/widgets.c 2007-06-16 13:10:26.000000000 +0200 >@@ -438,30 +438,7 @@ > > void put_text(gchar *string, guint size) > { >- int pos; >- GString *buffer_tmp; >- gchar *in_buffer; >- >- buffer_tmp = g_string_new(string); >- in_buffer=buffer_tmp->str; >- >- in_buffer += size; >- for(pos=size; pos>0; pos--) >- { >- in_buffer--; >- if(*in_buffer=='\r' && *(in_buffer+1) != '\n') >- { >- g_string_insert_c(buffer_tmp, pos, '\n'); >- size += 1; >- } >- if(*in_buffer=='\n' && *(in_buffer-1) != '\r') >- { >- g_string_insert_c(buffer_tmp, pos-1, '\r'); >- size += 1; >- } >- } >- >- vte_terminal_feed(VTE_TERMINAL(display), buffer_tmp->str, size); >+ vte_terminal_feed(VTE_TERMINAL(display), string, size); > } > > gint send_serial(gchar *string, gint len) >--- gtkterm-0.99.5/src/serie.c.crlf 2005-09-22 21:49:38.000000000 +0200 >+++ gtkterm-0.99.5/src/serie.c 2007-06-16 13:10:26.000000000 +0200 >@@ -111,8 +111,8 @@ > > int Send_chars(char *string, int length) > { >- char *buffer, *start_buffer; >- int i, size_written, buf_length; >+ char *buffer /*, *start_buffer */; >+/* int i, size_written, buf_length; */ > int bytes_written = 0; > > /* Normally it never happens, but it is better not to segfault ;) */ >@@ -120,8 +120,11 @@ > return 0; > > buffer=string; >+ >+ /* HDG <j.w.r.degoede@hhs.nl> this is non sense, when sending enter it >+ should be just '\r' and not "\r\n", disabling */ > >- if(config.crlfauto) >+/* if(config.crlfauto) > { > if(length == 1) > { >@@ -184,7 +187,7 @@ > bytes_written += write(serial_port_fd, "\n", 1); > } > } >- else >+ else */ > { > bytes_written = write(serial_port_fd, buffer, length); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 244182
:
156988
|
156989
|
157139
|
157140
| 157187