editorconfig / editorconfig-geany

EditorConfig plugin for Geany
http://editorconfig.org
GNU General Public License v2.0
44 stars 12 forks source link

No binary file on sourceforge.net #2

Closed jiafulow closed 8 years ago

jiafulow commented 8 years ago

The link for the Geany plugin binary file: http://sourceforge.net/projects/editorconfig/files/EditorConfig-Geany-Plugin/ does not contain the binary file. :(

xuhdev commented 8 years ago

@jiafulow Yeah that's a bit surprising---the binary file was removed because I wasn't able to build the binary which can work on all platforms. Do you have any problems to build the binary from source?

jiafulow commented 8 years ago

@xuhdev Ok, I see. I haven't tried building from source -- I'll try it during the weekends.

jiafulow commented 8 years ago

Sorry for the delay in getting back. The "install from source" instructions work. For reference, I'm on Linux Mint 17.3 (based on Ubuntu 14.04) and I installed EditorConfig library from the official repository: apt-get install editorconfig libeditorconfig-dev.

I can also confirm the plugin works and reads my .editorconfig file correctly. But there is a seg fault if there is no file in the current session. I believe it's due to gd->file_name returning NULL when there is no file. If I change line 74:

-    if ((err_num = editorconfig_parse(gd->file_name, eh)) != 0 &&
+    if ((err_num = editorconfig_parse(DOC_FILENAME(gd), eh)) != 0 &&

then the seg fault is gone in that case. The macro DOC_FILENAME returns a string "untitled" when gd->file_name is NULL. Maybe there is a better fix, but I hope this helps.

xuhdev commented 8 years ago

@jiafulow Thanks! Do you want to make a PR to fix this? Or I can commit the fix.

jiafulow commented 8 years ago

@xuhdev Ok, I just submitted PR #3 .

xuhdev commented 8 years ago

I've updated the README (1ca9a7ad0d03f17f766511d50a85c9f24f107201) which should fix this issue.