X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=args.h;h=660e2710660535ffa7f755169821fbeb1fbe0043;hb=ff35ac10e995043ddbc05154f185784b9918d48b;hp=76b245214118b9842f465edf12a2f7759f5e1724;hpb=deb0bc214fa41a647853e74a7eb433f2598682ac;p=xboard.git diff --git a/args.h b/args.h index 76b2452..660e271 100644 --- a/args.h +++ b/args.h @@ -5,7 +5,7 @@ * Massachusetts. * * Enhancements Copyright 1992-2001, 2002, 2003, 2004, 2005, 2006, - * 2007, 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc. + * 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 Free Software Foundation, Inc. * * Enhancements Copyright 2005 Alessandro Scotti * @@ -907,7 +907,7 @@ ParseArgs(GetFunc get, void *cl) ch = get(cl); while (ch != '\n' && ch != NULLCHAR) ch = get(cl); continue; - } else if (ch == '/' || ch == '-') { + } else if (ch == SLASH || ch == '-') { /* Switch */ q = argName; while (ch != ' ' && ch != '=' && ch != ':' && ch != NULLCHAR && @@ -922,6 +922,7 @@ ParseArgs(GetFunc get, void *cl) char endChar = (ch && ch != '\n' && (ch = get(cl)) == '{' ? '}' : '\n'); ExitArgError(_("Unrecognized argument %s"), argName, get != &FileGet); // [HGM] make unknown argument non-fatal while (ch != endChar && ch != NULLCHAR) ch = get(cl); // but skip rest of line it is on (or until closing '}' ) + if(ch == '}') ch = get(cl); continue; // so that when it is in a settings file, it is the only setting that will be purged from it } } else if (ch == '@') { @@ -1104,6 +1105,12 @@ ParseArgs(GetFunc get, void *cl) case ArgString: case ArgFilename: + if(argValue[0] == '~' && argValue[1] == '~') { + char buf[4*MSG_SIZ]; // expand ~~ + snprintf(buf, 4*MSG_SIZ, "%s%s", DATADIR, argValue+2); + ASSIGN(*(char **) ad->argLoc, buf); + break; + } ASSIGN(*(char **) ad->argLoc, argValue); break;