r41: Minor bugfix (implicit placement warning)
[carnet-tools-cn.git] / cp-update
index 2207c40..ecac2f7 100755 (executable)
--- a/cp-update
+++ b/cp-update
@@ -299,8 +299,8 @@ sub add() {
       }
       ++ $lineNo;
     }
-    if (! $added) {
-      warn "$ProgramName: Inserting lines at the end implicitly!\n";
+    if ($MatchLine and ! $added) {
+      warn "$ProgramName: Inserting lines at the end implicitly! No '$MatchLine'\n";
       push(@Lines, $StdinContent);
     }
   }