HomePhabricator

Unescape sequences in .cow files which look like escaped sequences

Description

Unescape sequences in .cow files which look like escaped sequences

Summary:
Cowsay's .cow files are perl scripts which contain escaped character sequences. This results in an excess of backslashes in the rendered cow. This change replaces occurrences of \x with just x.

This change also introduces conditional unescaping based on whether the cowfile is an original perl-script cowfile or a plain ascii-art file.

Refs T9471

Test Plan:
Use cowsay in a comment and verify that the rendered cow displays appropriately.
Use cowsay with the "dragon" cow and verify that the rendered dragon displays appropriately (contains \@ sequence).

Reviewers: Blessed Reviewers, epriestley

Reviewed By: Blessed Reviewers, epriestley

Subscribers: Korvin

Maniphest Tasks: T9471

Differential Revision: https://secure.phabricator.com/D14170

Details

Provenance
cspeckmimAuthored on
epriestleyCommitted on Sep 26 2015, 4:10 AM
epriestleyPushed on Sep 26 2015, 4:11 AM
Reviewer
Blessed Reviewers
Differential Revision
D14170: Unescape sequences in .cow files which look like escaped sequences
Parents
rPHUc72eb747e706: Fix an issue with PhutilConsoleTable alignment
Branches
Unknown
Tags
Unknown
Tasks
T9471: New cowsay implementation renders .cow escape sequences