Commits

Anonymous committed b380735

fix escaping / toast

Comments (0)

Files changed (1)

src/jp/co/itpl/ocamlandroid/MainActivity.java

 	volatile PrintWriter out = null;
 
 	private static String jsescape(String line) {
-		return line.replace("'", "\\'").replace("\n", "\\n"); // FIXME
+		return line.replace("\\", "\\\\").replace("'", "\\'").replace("\n", "\\n"); // FIXME
 	}
 	
 	private void println(String line) {
 				KeyEvent shiftPressEvent = new KeyEvent(0, 0,
 						KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_SHIFT_LEFT, 0, 0);
 				shiftPressEvent.dispatch(outView);
-				Toast.makeText(this, R.string.copy_howto, Toast.LENGTH_LONG);
+				Toast.makeText(this, R.string.copy_howto, Toast.LENGTH_LONG).show();
 			} catch (Exception e) {
 				throw new AssertionError(e);
 			}