Code

Documentation/git-submodule.txt: Further clarify the description
[git.git] / builtin-mailinfo.c
index 3e5fe5108533407e0319bbfda19fa63f991e17d2..b99a5b6f9679061d75e9c48e2fa5877e27920dc3 100644 (file)
@@ -225,10 +225,9 @@ static void cleanup_subject(struct strbuf *subject)
                        continue;
                case '[':
                        if ((pos = strchr(subject->buf, ']'))) {
-                               remove = pos - subject->buf + 1;
-                               /* Don't remove too much. */
-                               if (remove <= (subject->len - remove + 1) * 2) {
-                                       strbuf_remove(subject, 0, remove);
+                               remove = pos - subject->buf;
+                               if (remove <= (subject->len - remove) * 2) {
+                                       strbuf_remove(subject, 0, remove + 1);
                                        continue;
                                }
                        } else
@@ -907,7 +906,7 @@ static int mailinfo(FILE *in, FILE *out, int ks, const char *encoding,
 }
 
 static const char mailinfo_usage[] =
-       "git-mailinfo [-k] [-u | --encoding=<encoding>] msg patch <mail >info";
+       "git mailinfo [-k] [-u | --encoding=<encoding> | -n] msg patch <mail >info";
 
 int cmd_mailinfo(int argc, const char **argv, const char *prefix)
 {