From c9d8ab5522a3b608170a8ce1c1ef07078d992e37 Mon Sep 17 00:00:00 2001 From: GloamXun Date: Wed, 2 Dec 2026 19:10:40 +0800 Subject: [PATCH] Use a short private scratch path for Windows BibTeX --- examples/native_editor/bibliography.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/examples/native_editor/bibliography.rs b/examples/native_editor/bibliography.rs index e8a1b12..7ac05fd 100644 --- a/examples/native_editor/bibliography.rs +++ b/examples/native_editor/bibliography.rs @@ -482,6 +482,14 @@ struct Scratch(PathBuf); impl Scratch { fn new(cwd: &Path) -> io::Result { + // Kpathsea uses Win32 paths for its outputs. Its AUX/BBL filenames + // can exceed that limit under the editor's nested project run. + #[cfg(windows)] + let temporary = windows::bundled_directory() + .map(|_| std::env::temp_dir().canonicalize()) + .transpose()?; + #[cfg(windows)] + let cwd = temporary.as_deref().unwrap_or(cwd); static NEXT: AtomicU64 = AtomicU64::new(0); let mut builder = fs::DirBuilder::new(); #[cfg(unix)]