Changeset ba26129 in mainline
- Timestamp:
- 2009-11-30T18:50:08Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0f06dbc
- Parents:
- 1352fc1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/edit/edit.c
r1352fc1 rba26129 102 102 #define ED_INFTY 65536 103 103 104 /** Maximum filename length that can be entered. */ 105 #define INFNAME_MAX_LEN 128 106 104 107 static void key_handle_unmod(console_event_t const *ev); 105 108 static void key_handle_ctrl(console_event_t const *ev); … … 331 334 } 332 335 333 #define INPUT_MAX_LEN 64334 335 336 /** Ask for a file name. */ 336 337 static char *filename_prompt(char const *prompt, char const *init_value) … … 338 339 console_event_t ev; 339 340 char *str; 340 wchar_t buffer[INPUT_MAX_LEN + 1]; 341 wchar_t buffer[INFNAME_MAX_LEN + 1]; 342 int max_len; 341 343 int nc; 342 344 bool done; … … 349 351 console_set_color(con, COLOR_WHITE, COLOR_BLACK, 0); 350 352 351 str_to_wstr(buffer, INPUT_MAX_LEN + 1, init_value); 353 max_len = min(INFNAME_MAX_LEN, scr_columns - 4 - str_length(prompt)); 354 str_to_wstr(buffer, max_len + 1, init_value); 352 355 nc = wstr_length(buffer); 353 356 done = false; … … 376 379 break; 377 380 default: 378 if (ev.c >= 32 && nc < INPUT_MAX_LEN) {381 if (ev.c >= 32 && nc < max_len) { 379 382 putchar(ev.c); 380 383 fflush(stdout);
Note:
See TracChangeset
for help on using the changeset viewer.