From 1f5bea611d6ea92d7edbc296689f6f94214bdf31 Mon Sep 17 00:00:00 2001 From: xTibor <xnagytibor@gmail.com> Date: Tue, 11 Apr 2017 05:26:10 +0200 Subject: [PATCH] Fix the listing of `initfs:` directories There was a bug at the `initfs` generation which made the listing of the contents of the `initfs:`subdirectories impossible from the command line. The subdirectory listing data had the full paths of the files (like `bin/ahcid\nbin/bgad\n...`) when it should just only be the names of the files (`ahcid\nbgad\n...`) --- build.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.rs b/build.rs index 53d07ee5..117deebe 100644 --- a/build.rs +++ b/build.rs @@ -66,6 +66,7 @@ fn fill_from_location(f: &mut fs::File, loc: &Path ) -> Result<(), (Error)> { let sub = folders.get(*dir).unwrap(); let mut first = true; for child in sub.iter() { + let idx = child.rfind('/').unwrap() + 1; let (_, c) = child.split_at(idx); if first { write!(f, "{}", c)?; @@ -108,4 +109,4 @@ mod gen { } } ").unwrap(); -} \ No newline at end of file +} -- GitLab