termux-packages/packages/texlive/dvipdfm-x_fix_getpass.patch

23 lines
621 B
Diff
Raw Normal View History

--- src/texk/dvipdfm-x/pdfencrypt.h~ 2016-01-06 11:13:28.000000000 +0100
+++ src/texk/dvipdfm-x/pdfencrypt.h 2016-12-31 11:13:43.734942973 +0100
@@ -38,4 +38,19 @@
unsigned char **cipher, size_t *cipher_len);
extern pdf_obj *pdf_encrypt_obj (void);
+
+#ifdef __ANDROID__
+static char* getpass(const char* prompt) {
+ static char chars[128];
+ int len = 0;
+ while (true) {
+ char c = fgetc(stdin);
+ if (c == '\r' || c == '\n' || c == 0) break;
+ chars[len++] = c;
+ if (len == sizeof(chars)-1) break;
+ }
+ chars[len] = 0;
+ return chars;
+}
+#endif
#endif /* _PDFENCRYPT_H_ */