diff -rc pwsafe-0.2.0.orig/pwsafe.cpp pwsafe-0.2.0/pwsafe.cpp *** pwsafe-0.2.0.orig/pwsafe.cpp 2005-09-30 06:30:56.000000000 -0400 --- pwsafe-0.2.0/pwsafe.cpp 2008-02-04 22:18:58.000000000 -0500 *************** *** 1432,1442 **** #if WITH_READLINE rl_completion_entry_function = dummy_completion; // we don't need readline doing any tab completion (and especially not filenames) #endif #if READLINE_H_USES_NO_CONST ! char* x = readline(const_cast(prompt)); #else ! char* x = readline(prompt); #endif if (x) { secstring xx(x); memset(x,0,strlen(x)); --- 1432,1480 ---- #if WITH_READLINE rl_completion_entry_function = dummy_completion; // we don't need readline doing any tab completion (and especially not filenames) #endif + char* start = NULL; + int total_len = 0; + char* x; + do { #if READLINE_H_USES_NO_CONST ! if (!start) { ! x = readline(const_cast(prompt)); ! } else { ! x = readline("> "); ! } #else ! if (!start) { ! x = readline(prompt); ! } else { ! x = readline("> "); ! } #endif + if (!x) { + start = NULL; + break; + } + int len = strlen(x); + if (start) { + char *tmp = (char*)malloc(total_len + len + 1); + strcpy(tmp, start); + strcpy(tmp + total_len, x); + total_len += len; + free(start); + free(x); + start = tmp; + } else { + start = x; + total_len = len; + } + if (*(start + total_len - 1) == '\\') { + *(start + total_len - 1) = '\n'; + } else { + break; + } + } while (1); + + x = start; + if (x) { secstring xx(x); memset(x,0,strlen(x));