@@ -1,5 +1,7 @@
if (some_var1) {
do {
+ if (some_var2) {
some-code
+ }
} while (1);
}
```
but this behavior will change if line 5 would be equal line 6
(containing only brace ...).
2. now we'll modify that a bit (e. g. use while instead of do, to make
the lines more similar
(containing only braces):
```
printf "if (some_var1) {\n while (1) {\n some-code\n }\n}\n" > a.c
printf "if (some_var1) {\n while (1) {\n if (some_var2) {\n
some-code\n }\n }\n}\n" > b.c
git diff --ignore-space-change --no-index a.c b.c
```
which then would produce this result:
```
@@ -1,5 +1,7 @@
if (some_var1) {
while (1) {
+ if (some_var2) {
some-code
}
+ }
}
```
As one can see, a line 6 instead of line 5 is marked as new (thereby
line 6 was **completely unmodified**).
In my opinion correct would be this variant (also similar patch of
test in step 1):
```
@@ -1,5 +1,7 @@
if (some_var1) {
while (1) {
+ if (some_var2) {
some-code
+ }
}
}