marvinkreis / rofi-file-browser-extended

Use rofi to quickly open files
MIT License
240 stars 15 forks source link

Fix compatibility with non-glibc systems #40

Closed jirutka closed 2 years ago

jirutka commented 2 years ago

Resolves #20

anoduck commented 2 years ago

Looking forward to this pull request getting merged.

marvinkreis commented 2 years ago

Hi. Thank you for the contribution.

I had some problems getting this to work on my (glibc) system. Had some compile errors at first, then, when when running it, the file browser would only ever show the first file in the directory. I'm not very good at C preprocessor magic, so I tried to fix it by simply always using the compat implementation, which seems to work fine. I pushed this onto the nftw_compat branch. Could you check if it works on your system?

jirutka commented 2 years ago

I pushed some WIP changes, but I’m too tired now, so I will write a comment tomorrow.

jirutka commented 2 years ago

I have to admit that I haven’t tested it on glibc system before; sorry about that.

I updated this PR, now it builds both on glibc and non-glibc systems (and this time I really tested it on glibc system) and the compatibility nftw implementation is used only when the system one doesn’t define glibc extensions. I also renamed compat to posix-compat and moved extended_nftw.h into src/posix-compat/, which I think is more correct (it’s an internal thing of files.c, it shouldn’t be exposed to outside).

marvinkreis commented 2 years ago

Works perfectly now. Thank you!