Commit b802d64fa1d83ca695519cdf9d119bfb235493a9
1 parent
629ab559
Exists in
master
and in
5 other branches
Ajustes no módulo de transferência de arquivos
Showing
2 changed files
with
26 additions
and
2 deletions
Show diff stats
src/lib3270/ft.c
... | ... | @@ -226,7 +226,21 @@ static void set_ft_state(H3270FT *session, LIB3270_FT_STATE state); |
226 | 226 | |
227 | 227 | // Open local file |
228 | 228 | #ifdef _WIN32 |
229 | - ft_local_file = fopen(local,(flags & LIB3270_FT_OPTION_RECEIVE) ? ((flags & LIB3270_FT_OPTION_APPEND) ? "ab" : "wb") : "rb"); | |
229 | + | |
230 | + char openmode[5] = ""; | |
231 | + int opensize = 0; | |
232 | + | |
233 | + openmode[opensize++] = flags & LIB3270_FT_OPTION_RECEIVE ? "r" : "w"; | |
234 | + openmode[opensize++] = flags & LIB3270_FT_OPTION_CRLF ? "t" : "b"; | |
235 | + | |
236 | + // É para adicionar? | |
237 | + if(flags & LIB3270_FT_OPTION_APPEND) { | |
238 | + openmode[opensize++] = 'a'; | |
239 | + } | |
240 | + | |
241 | + openmode[opensize++] = 0; | |
242 | + ft_local_file = fopen(local,openmode); | |
243 | + | |
230 | 244 | #else |
231 | 245 | ft_local_file = fopen(local,(flags & LIB3270_FT_OPTION_RECEIVE) ? ((flags & LIB3270_FT_OPTION_APPEND) ? "a" : "w") : "r"); |
232 | 246 | #endif // _WIN32 |
... | ... | @@ -289,7 +303,7 @@ static void set_ft_state(H3270FT *session, LIB3270_FT_STATE state); |
289 | 303 | |
290 | 304 | LIB3270_EXPORT int lib3270_ft_start(H3270 *hSession) |
291 | 305 | { |
292 | - static const char * rec = "fvu"; | |
306 | + static const char * rec = "FVU"; | |
293 | 307 | static const char * un[] = { "tracks", "cylinders", "avblock" }; |
294 | 308 | |
295 | 309 | char op[4096]; | ... | ... |
src/pw3270/ft/ftdialog.c
... | ... | @@ -457,8 +457,13 @@ GtkWidget * v3270_ft_dialog_new(GtkWidget *parent, LIB3270_FT_OPTION options) |
457 | 457 | { |
458 | 458 | LIB3270_FT_OPTION_CRLF, |
459 | 459 | BUTTON_CRLF, |
460 | +#ifdef _WIN32 | |
460 | 461 | N_( "Terminate records with _CR/LF." ), |
461 | 462 | N_( "Following the convention for ASCII text files, <CR> <LF> pairs are used to terminate records in the PC file.") |
463 | +#else | |
464 | + N_( "Terminate records with _LF." ), | |
465 | + N_( "Following the convention for ASCII text files, <LF> is used to terminate records in the PC file.") | |
466 | +#endif // _WIN32 | |
462 | 467 | }, |
463 | 468 | { |
464 | 469 | LIB3270_FT_OPTION_APPEND, |
... | ... | @@ -547,8 +552,13 @@ GtkWidget * v3270_ft_dialog_new(GtkWidget *parent, LIB3270_FT_OPTION options) |
547 | 552 | { |
548 | 553 | LIB3270_FT_OPTION_CRLF, |
549 | 554 | BUTTON_CRLF, |
555 | +#ifdef _WIN32 | |
550 | 556 | N_( "Terminate records with _CR/LF." ), |
551 | 557 | N_( "Following the convention for ASCII text files, <CR> <LF> pairs are used to terminate records in the PC file.") |
558 | +#else | |
559 | + N_( "Terminate records with _LF." ), | |
560 | + N_( "Following the convention for ASCII text files, <LF> is used to terminate records in the PC file.") | |
561 | +#endif // _WIN32 | |
552 | 562 | }, |
553 | 563 | { |
554 | 564 | LIB3270_FT_OPTION_APPEND, | ... | ... |