Created
October 15, 2011 02:11
-
-
Save codebrainz/1288898 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/src/utils.c b/src/utils.c | |
| index cd06641..ff52a13 100644 | |
| --- a/src/utils.c | |
| +++ b/src/utils.c | |
| @@ -103,6 +103,7 @@ void utils_open_browser(const gchar *uri) | |
| /* taken from anjuta, to determine the EOL mode of the file */ | |
| gint utils_get_line_endings(const gchar* buffer, gsize size) | |
| { | |
| +# define MAX_LINES 10 | |
| gsize i; | |
| guint cr, lf, crlf, max_mode; | |
| gint mode; | |
| @@ -138,6 +139,8 @@ gint utils_get_line_endings(const gchar* buffer, gsize size) | |
| i++; | |
| } | |
| } | |
| + if ((lf + cr + crlf) > MAX_LINES) | |
| + break; | |
| } | |
| /* Vote for the maximum */ | |
| @@ -155,6 +158,7 @@ gint utils_get_line_endings(const gchar* buffer, gsize size) | |
| } | |
| return mode; | |
| +# undef MAX_LINES | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment