Commit cf5ab837ec239740ceccc3296e7fb319407626a3

Authored by Perry Werneck
1 parent 1953ac0d

Incluindo opção para definir o delimitador de linha ao carregar o conteúdo da tela.

Showing 3 changed files with 7 additions and 7 deletions   Show diff stats
macros.c
... ... @@ -103,7 +103,7 @@
103 103 switch(argc)
104 104 {
105 105 case 1: // Get entire screen
106   - buffer = lib3270_get_text(hSession,0,-1);
  106 + buffer = lib3270_get_text(hSession,0,-1,'\n');
107 107 break;
108 108  
109 109 /*
... ...
screen.c
... ... @@ -374,7 +374,7 @@ void screen_update(H3270 *session, int bstart, int bend)
374 374  
375 375 #ifdef DEBUG
376 376 {
377   - char *text = lib3270_get_text(session,0,-1);
  377 + char *text = lib3270_get_text(session,0,-1,'\n');
378 378 trace("First screen:\n%s\n",text);
379 379 lib3270_free(text);
380 380 }
... ...
selection.c
... ... @@ -475,7 +475,7 @@ LIB3270_EXPORT char * lib3270_get_region(H3270 *h, int start_pos, int end_pos, u
475 475 return lib3270_realloc(text,sz);
476 476 }
477 477  
478   -LIB3270_EXPORT char * lib3270_get_text(H3270 *h, int offset, int len)
  478 +LIB3270_EXPORT char * lib3270_get_text(H3270 *h, int offset, int len, char lf)
479 479 {
480 480 char * buffer;
481 481 int maxlen;
... ... @@ -517,9 +517,9 @@ LIB3270_EXPORT char * lib3270_get_text(H3270 *h, int offset, int len)
517 517 offset++;
518 518 len--;
519 519  
520   - if((offset%h->cols) == 0 && len > 0)
  520 + if(lf && (offset%h->cols) == 0 && len > 0)
521 521 {
522   - *(ptr++) = '\n';
  522 + *(ptr++) = lf;
523 523 len--;
524 524 }
525 525 }
... ... @@ -533,7 +533,7 @@ LIB3270_EXPORT char * lib3270_get_text(H3270 *h, int offset, int len)
533 533 LIB3270_EXPORT char * lib3270_get_text_at(H3270 *h, int row, int col, int len)
534 534 {
535 535 CHECK_SESSION_HANDLE(h);
536   - return lib3270_get_text(h, ((row-1) * h->cols) + (col-1), len);
  536 + return lib3270_get_text(h, ((row-1) * h->cols) + (col-1), len, '\n');
537 537 }
538 538  
539 539 LIB3270_EXPORT int lib3270_cmp_text_at(H3270 *h, int row, int col, const char *text)
... ... @@ -569,7 +569,7 @@ LIB3270_EXPORT char * lib3270_get_field_at(H3270 *session, int baddr)
569 569 if(first < 0)
570 570 return NULL;
571 571  
572   - return lib3270_get_text(session,first,lib3270_field_length(session,first)+1);
  572 + return lib3270_get_text(session,first,lib3270_field_length(session,first)+1,0);
573 573 }
574 574  
575 575 LIB3270_EXPORT int lib3270_has_selection(H3270 *hSession)
... ...