no strndup when truncating pattern
partially