Ubuntu Pastebin

Paste from nacc at Fri, 22 Jul 2016 19:05:13 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/command-not-found b/command-not-found
index 21f69a5..e69a9a9 100755
--- a/command-not-found
+++ b/command-not-found
@@ -86,9 +86,12 @@ def main():
                       help=_("don't print '<command-name>: command not found'"))
     (options, args) = parser.parse_args()
     if len(args) == 1:
-        cnf = CommandNotFound(options.data_dir)
-        if not cnf.advise(args[0], options.ignore_installed) and not options.no_failure_msg:
-            print(_("%s: command not found") % args[0], file=sys.stderr)
+        if (len(args[0]) > 255:
+            print(_("%s: command too long") % args[0], file=sys.stderr)
+        else:
+            cnf = CommandNotFound(options.data_dir)
+            if not cnf.advise(args[0], options.ignore_installed) and not options.no_failure_msg:
+                print(_("%s: command not found") % args[0], file=sys.stderr)
 
 if __name__ == "__main__":
     crash_guard(main, BUG_REPORT_URL, __version__)
Download as text