From e6f17735b894d458cb3762734744985e072709a4 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Sun, 23 May 2021 14:09:50 -0400 Subject: [PATCH] Modified the "cmdDumpParseArgs()" routine (used, for instance, by the "getcell" command) so that the "parent" and "child" arguments will accept the standard syntax for coordinates used by most other commands (will accept SI units or trailing suffix i/l for internal or lambda units). --- commands/CmdCD.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/commands/CmdCD.c b/commands/CmdCD.c index 1ba9e472..57c2dd26 100644 --- a/commands/CmdCD.c +++ b/commands/CmdCD.c @@ -4396,15 +4396,10 @@ cmdDumpParseArgs(cmdName, w, cmd, dummy, scx) TxError("Keyword must be followed by a reference point\n"); goto usage; } - if (StrIsInt(av[1])) + else if (ac == 3) { - childPoint.p_x = atoi(av[1]); - if (ac < 3 || !StrIsInt(av[2])) - { - TxError("Must provide two coordinates\n"); - goto usage; - } - childPoint.p_y = atoi(av[2]); + childPoint.p_x = cmdParseCoord(w, av[1], TRUE, TRUE); + childPoint.p_y = cmdParseCoord(w, av[2], TRUE, FALSE); av += 3; ac -= 3; } @@ -4455,15 +4450,10 @@ cmdDumpParseArgs(cmdName, w, cmd, dummy, scx) TxError("Keyword must be followed by a reference point\n"); goto usage; } - if (StrIsInt(av[1])) + else if (ac == 3) { - editPoint.p_x = atoi(av[1]); - if (ac < 3 || !StrIsInt(av[2])) - { - TxError("Must provide two coordinates\n"); - goto usage; - } - editPoint.p_y = atoi(av[2]); + editPoint.p_x = cmdParseCoord(w, av[1], TRUE, TRUE); + editPoint.p_y = cmdParseCoord(w, av[2], TRUE, FALSE); av += 3; ac -= 3; GeoTransPoint(&EditToRootTransform, &editPoint,