diff --git a/git_integration.c b/git_integration.c index f62cb4b..c0d299e 100644 --- a/git_integration.c +++ b/git_integration.c @@ -165,13 +165,10 @@ int get_last_commit(char *title, size_t title_size, char *hash, pclose(fp); } - fp = popen("git log -1 --pretty=format:'%s' 2>/dev/null", "r"); + fp = popen("git log -1 --pretty=format:%s 2>/dev/null", "r"); if (fp) { if (fgets(title, title_size, fp) != NULL) { - if (title[0] == '\'' && title[strlen(title)-1] == '\'') { - memmove(title, title + 1, strlen(title) - 1); - title[strlen(title) - 1] = '\0'; - } + // No need to remove quotes since we're not using them in the format } pclose(fp); } @@ -185,7 +182,7 @@ int get_recent_commit(char commits[][256], int count) { } char cmd[256]; - snprintf(cmd, sizeof(cmd), "git log -%d --pretty=format:'%%s' 2>/dev/null", count); + snprintf(cmd, sizeof(cmd), "git log -%d --pretty=format:%%s 2>/dev/null", count); FILE *fp = popen(cmd, "r"); if (!fp) { @@ -197,11 +194,6 @@ int get_recent_commit(char commits[][256], int count) { char *newline = strchr(commits[retrieved], '\n'); if (newline) *newline = '\0'; - if (commits[retrieved][0] == '\'' && commits[retrieved][strlen(commits[retrieved])-1] == '\'') { - memmove(commits[retrieved], commits[retrieved] + 1, strlen(commits[retrieved]) - 1); - commits[retrieved][strlen(commits[retrieved]) - 1] = '\0'; - } - retrieved++; } diff --git a/git_integration.o b/git_integration.o index e022209..435fca0 100644 Binary files a/git_integration.o and b/git_integration.o differ diff --git a/shell b/shell index 86be6e7..ed2ba6c 100755 Binary files a/shell and b/shell differ