Apparent bug in nvram --set output

Discussion in 'Tomato Firmware' started by jerrm, May 28, 2013.

  1. jerrm

    jerrm Network Guru Member

    Backticks ` - are escaped as "\$" instead of "\`"

    Relevant section of nvram.c from git:
    Code:
    426 static int export_main(int argc, char **argv)
    ... ...
    513             case '$':
    514             case '`':
    515                     if (mode != X_SET) putchar(*p);
    516                     else printf("\\$");
    517                     break;
    
     
  2. Kevin Darbyshire-Bryant

    Kevin Darbyshire-Bryant Networkin' Nut Member

    Will take a look tomorrow but it does look wrong!
     
  3. jerrm

    jerrm Network Guru Member

    I can't imagine why it would be like that on purpose, found it when I was looking to see what to escape for this script.

    The script escapes backticks properly and everything imports back in correctly when executed.

    I generally use $() syntax instead of backticks and had never noticed before.
     
  4. Kevin Darbyshire-Bryant

    Kevin Darbyshire-Bryant Networkin' Nut Member

  5. jerrm

    jerrm Network Guru Member

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice