Browse Source

ob-C: more generous regular expression for matching main call

* lisp/ob-C.el (org-babel-C-ensure-main-wrap): more generous regular
  expression for matching main function
Eric Schulte 14 years ago
parent
commit
bb8086ffbb
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lisp/ob-C.el

+ 1 - 1
lisp/ob-C.el

@@ -151,7 +151,7 @@ it's header arguments."
 
 (defun org-babel-C-ensure-main-wrap (body)
   "Wrap body in a \"main\" function call if none exists."
-  (if (string-match "^[ \t]*[intvod]+[ \t]*main[ \t]*(.*)" body)
+  (if (string-match "^[ \t]*[intvod]+[ \t\n\r]*main[ \t]*(.*)" body)
       body
     (format "int main() {\n%s\n}\n" body)))