Blame src/to_c_cmd.py

Packit 1c1d7e
# place " at begin of each line
Packit 1c1d7e
# escape existing '\' and '"'
Packit 1c1d7e
# remove \n at the end of the line (sometimes the last line does not have a \n
Packit 1c1d7e
#   so we cannot do a replacement with some other text)
Packit 1c1d7e
# place an escaped \n and " at the end of each line
Packit 1c1d7e
import sys
Packit 1c1d7e
for line in sys.stdin:
Packit 1c1d7e
    sys.stdout.write('"' + line.replace('\\','\\\\').replace('"','\\"').replace('\n','') + '\\n"\n')