Skip to content

Commit 8f744e0

Browse files
committed
Fix silly mistake 2: Not setting aux location, and add test for nested aux files
1 parent 37871ac commit 8f744e0

8 files changed

Lines changed: 34 additions & 1 deletion

File tree

crates/engine_bibtex/src/c_api/pool.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,8 @@ pub unsafe extern "C" fn pre_def_certain_strings(ctx: *mut Bibtex) -> CResult {
285285
let ctx = &mut *ctx;
286286
let res = with_hash_mut(|hash| {
287287
with_pool_mut(|pool| {
288-
pool.lookup_str_insert(hash, b".aux", StrIlk::FileExt)?;
288+
let res = pool.lookup_str_insert(hash, b".aux", StrIlk::FileExt)?;
289+
ctx.s_aux_extension = hash.text(res.loc);
289290

290291
let res = pool.lookup_str_insert(hash, b"\\citation", StrIlk::AuxCommand)?;
291292
hash.set_ilk_info(res.loc, 2);

tests/bibtex.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,3 +160,8 @@ fn test_single_preamble() {
160160
fn test_many_preamble() {
161161
TestCase::new("many", Some("preamble")).go();
162162
}
163+
164+
#[test]
165+
fn test_nested_aux() {
166+
TestCase::new("nested", Some("aux")).go();
167+
}

tests/bibtex/aux/nested.aux

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
\@input{nested2.aux}

tests/bibtex/aux/nested.bbl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
\begin{thebibliography}{1}
2+
3+
\bibitem{Book01}
4+
Author McAuthor.
5+
\newblock {\em The book of all time}.
6+
\newblock Publisher, 1998.
7+
8+
\end{thebibliography}

tests/bibtex/aux/nested.bib

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
@book { Book01,
2+
author = "Author McAuthor",
3+
title = "The book of all time",
4+
year = "1998",
5+
publisher = "Publisher",
6+
}

tests/bibtex/aux/nested.blg

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
This is BibTeX, Version 0.99d
2+
Capacity: max_strings=35307, hash_size=35307, hash_prime=30011
3+
The top-level auxiliary file: nested.aux
4+
A level-1 auxiliary file: nested2.aux
5+
A level-2 auxiliary file: nested3.aux
6+
The style file: ../plain.bst
7+
Database file #1: nested.bib

tests/bibtex/aux/nested2.aux

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
\@input{nested3.aux}

tests/bibtex/aux/nested3.aux

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
\relax
2+
\citation{Book01}
3+
\bibstyle{../plain}
4+
\bibdata{nested}

0 commit comments

Comments
 (0)