Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ag: Update to 2.0.0 and support detecting mintty #2555

Merged
merged 1 commit into from
Jun 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 1ede87c906fc1f9cab44f351c3eadf0080f75cf4 Mon Sep 17 00:00:00 2001
From bacedeb21cd30101b787838d003d686ae3036838 Mon Sep 17 00:00:00 2001
From: Ray Donnelly <[email protected]>
Date: Mon, 23 Feb 2015 21:46:45 +0000
Subject: [PATCH 1/6] lang: Allow both extensions and full filenames
Subject: [PATCH 1/7] lang: Allow both extensions and full filenames

Because many filetypes (e.g. make) are not indicated by the
file extension but instead by the full filename (Makefile).
Expand All @@ -16,10 +16,10 @@ are indicated by prefixing the pattern with a '^'.
3 files changed, 60 insertions(+), 47 deletions(-)

diff --git a/src/lang.c b/src/lang.c
index 96d6be0..37d61ac 100644
index 5ccd860..17783ae 100644
--- a/src/lang.c
+++ b/src/lang.c
@@ -109,20 +109,27 @@ size_t get_lang_count() {
@@ -115,20 +115,27 @@ size_t get_lang_count() {
return sizeof(langs) / sizeof(lang_spec_t);
}

Expand Down Expand Up @@ -55,7 +55,7 @@ index 96d6be0..37d61ac 100644
regex_capacity *= 2;
regex = ag_realloc(regex, regex_capacity);
}
@@ -131,8 +138,12 @@ char *make_lang_regex(char *ext_array, size_t num_exts) {
@@ -137,8 +144,12 @@ char *make_lang_regex(char *ext_array, size_t num_exts) {
} else {
subsequent = 1;
}
Expand All @@ -70,7 +70,7 @@ index 96d6be0..37d61ac 100644
}

regex[regex_length++] = ')';
@@ -141,29 +152,29 @@ char *make_lang_regex(char *ext_array, size_t num_exts) {
@@ -147,29 +158,29 @@ char *make_lang_regex(char *ext_array, size_t num_exts) {
return regex;
}

Expand Down Expand Up @@ -165,10 +165,10 @@ index d0007f9..202da4b 100644
+size_t combine_file_patterns(size_t *pattern_index, size_t len, char **pats);
#endif
diff --git a/src/options.c b/src/options.c
index 67567eb..1e7648e 100644
index dbe3e24..b8da938 100644
--- a/src/options.c
+++ b/src/options.c
@@ -212,9 +212,9 @@ void parse_options(int argc, char **argv, char **base_paths[], char **paths[]) {
@@ -224,9 +224,9 @@ void parse_options(int argc, char **argv, char **base_paths[], char **paths[]) {
size_t longopts_len, full_len;
option_t *longopts;
char *lang_regex = NULL;
Expand All @@ -181,7 +181,7 @@ index 67567eb..1e7648e 100644

init_options();

@@ -318,8 +318,8 @@ void parse_options(int argc, char **argv, char **base_paths[], char **paths[]) {
@@ -332,8 +332,8 @@ void parse_options(int argc, char **argv, char **base_paths[], char **paths[]) {
full_len = (longopts_len + lang_count + 1);
longopts = ag_malloc(full_len * sizeof(option_t));
memcpy(longopts, base_longopts, sizeof(base_longopts));
Expand All @@ -192,7 +192,7 @@ index 67567eb..1e7648e 100644

for (i = 0; i < lang_count; i++) {
option_t opt = { langs[i].name, no_argument, NULL, 0 };
@@ -561,7 +561,7 @@ void parse_options(int argc, char **argv, char **base_paths[], char **paths[]) {
@@ -580,7 +580,7 @@ void parse_options(int argc, char **argv, char **base_paths[], char **paths[]) {
for (i = 0; i < lang_count; i++) {
if (strcmp(longopts[opt_index].name, langs[i].name) == 0) {
has_filetype = 1;
Expand All @@ -201,7 +201,7 @@ index 67567eb..1e7648e 100644
break;
}
}
@@ -595,15 +595,15 @@ void parse_options(int argc, char **argv, char **base_paths[], char **paths[]) {
@@ -614,15 +614,15 @@ void parse_options(int argc, char **argv, char **base_paths[], char **paths[]) {
}

if (has_filetype) {
Expand All @@ -222,7 +222,7 @@ index 67567eb..1e7648e 100644
if (lang_regex) {
free(lang_regex);
}
@@ -644,8 +644,8 @@ void parse_options(int argc, char **argv, char **base_paths[], char **paths[]) {
@@ -663,8 +663,8 @@ void parse_options(int argc, char **argv, char **base_paths[], char **paths[]) {
for (lang_index = 0; lang_index < lang_count; lang_index++) {
printf(" --%s\n ", langs[lang_index].name);
int j;
Expand All @@ -234,5 +234,5 @@ index 67567eb..1e7648e 100644
printf("\n\n");
}
--
2.10.1
2.12.1

Loading