On Haiku, I see this compilation error:

../../gllib/mountlist.c: In function 'read_file_system_list':
../../gllib/mountlist.c:727:40: error: 're' undeclared (first use in this 
function); did you mean 'me'?
  727 |             me->me_mountdir = xstrdup (re != NULL ? re->name : 
fi.fsh_name);
      |                                        ^~

This patch fixes it.


2026-01-01  Bruno Haible  <[email protected]>

        mountlist: Fix compilation error on Haiku (regr. 2025-11-18).
        * lib/mountlist.c (read_file_system_list): Declare a variable before the
        'for' loop.

diff --git a/lib/mountlist.c b/lib/mountlist.c
index ac41e41b42..66b3f3d57c 100644
--- a/lib/mountlist.c
+++ b/lib/mountlist.c
@@ -1,6 +1,6 @@
 /* mountlist.c -- return a list of mounted file systems
 
-   Copyright (C) 1991-1992, 1997-2025 Free Software Foundation, Inc.
+   Copyright (C) 1991-1992, 1997-2026 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -717,7 +717,8 @@ read_file_system_list (bool need_fs_type)
         if (fs_stat_dev (dev, &fi) >= 0)
           {
             /* Note: fi.dev == dev. */
-            for (struct rootdir_entry *re = rootdir_list; re; re = re->next)
+            struct rootdir_entry *re;
+            for (re = rootdir_list; re; re = re->next)
               if (re->dev == fi.dev && re->ino == fi.root)
                 break;
 




Reply via email to