" and I find it hard to see how damages could be levied in this situation." Unfortunately, this would be intentional copyright infringement (assuming the code is copyrightable, blah blah blah), since you are doing it on purpose with knowledge that it is copyrighted. In a number of countries, copyright infringement is also strict liability - it doesn't matter if you had any intent to commit it, but if you did, the dam…
I was of the possibly wrong impression that statuatory damages require that the work have been registered with the library of congress. Which seems unlikely for a small patch that might not even be copyrightable anyway.