aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2021-06-19 23:16:52 +0200
committerJohn Ankarström <john@ankarstrom.se>2021-06-19 23:16:52 +0200
commitc0044f47f9e70067b05894280e2c231a35096bda (patch)
treef25b10e7c48d15311e7b59477f6317c15824f652
parente1293ee10f1d9a845a23bbe127a130c9d1eda3b7 (diff)
downloaddwim-c0044f47f9e70067b05894280e2c231a35096bda.tar.gz
Improve function(call handler
-rwxr-xr-xdwim3
1 files changed, 2 insertions, 1 deletions
diff --git a/dwim b/dwim
index c958585..b171ee6 100755
--- a/dwim
+++ b/dwim
@@ -77,10 +77,11 @@ for ($phrase) {
if (/^([A-Za-z_][A-Za-z0-9_]*)\(/) {
handle 'function(call';
my $dir = dir;
- s/\(.*//;
+ s/\(.*/(/;
for (`grep -n '^$_' "$dir"/*.c "$dir"/*.h`) {
run @EDITOR, "+$2", $1 if /([^:]+):(\d+):/;
}
+ fail 'could not find definition';
# FALLTHROUGH
}