Remove some code duplication in pattern.c
Remove some code duplication in pattern.c

liblouis/liblouis,liblouis/liblouis,BueVest/liblouis,hammera/liblouis,BueVest/liblouis,BueVest/liblouis,BueVest/liblouis,liblouis/liblouis,hammera/liblouis,hammera/liblouis,hammera/liblouis,hammera/liblouis,liblouis/liblouis,BueVest/liblouis,liblouis/liblouis,BueVest/liblouis,liblouis/liblouis,hammera/liblouis