summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/util/SourceFile.scala2
-rw-r--r--src/library/scala/sys/process/package.scala3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/util/SourceFile.scala b/src/compiler/scala/tools/nsc/util/SourceFile.scala
index 22820806be..4405b3457b 100644
--- a/src/compiler/scala/tools/nsc/util/SourceFile.scala
+++ b/src/compiler/scala/tools/nsc/util/SourceFile.scala
@@ -72,7 +72,7 @@ object ScriptSourceFile {
* with "!#" or "::!#".
*/
def headerLength(cs: Array[Char]): Int = {
- val headerPattern = Pattern.compile("""^(::)?!#.*(\r|\n|\r\n)""", Pattern.MULTILINE)
+ val headerPattern = Pattern.compile("""((?m)^(::)?!#.*|^.*/env .*)(\r|\n|\r\n)""")
val headerStarts = List("#!", "::#!")
if (headerStarts exists (cs startsWith _)) {
diff --git a/src/library/scala/sys/process/package.scala b/src/library/scala/sys/process/package.scala
index 17636c4c87..3eb0e5bb89 100644
--- a/src/library/scala/sys/process/package.scala
+++ b/src/library/scala/sys/process/package.scala
@@ -47,8 +47,9 @@ package scala.sys {
*
* {{{
* import java.io.File
+ * import java.net.URL
* import scala.sys.process._
- * new File("About.html") #> new File("About_copy.html") !
+ * new URL("http://www.scala-lang.org/") #> new File("scala-lang.html") !
* }}}
*
* One may use a `Process` directly through `ProcessBuilder`'s `run` method, which starts the process in