X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=Ada95%2Fsamples%2Fsplit-path.awk;fp=Ada95%2Fsamples%2Fsplit-path.awk;h=5b340ba5cd6a76de3a0b5aae5b5945fbecde9664;hp=86e8ccdc10f182de8df442772d172ecb7577d4c9;hb=205ea499dbbceba5201d997fbd8b6b1f7f29bd50;hpb=18c5cff3297b96ac5988a716c66b374734a7de90 diff --git a/Ada95/samples/split-path.awk b/Ada95/samples/split-path.awk index 86e8ccdc..5b340ba5 100644 --- a/Ada95/samples/split-path.awk +++ b/Ada95/samples/split-path.awk @@ -1,5 +1,5 @@ ############################################################################## -# Copyright 2020 Thomas E. Dickey # +# Copyright 2020,2022 Thomas E. Dickey # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -28,9 +28,11 @@ # # Author: Thomas E. Dickey # -# $Id: split-path.awk,v 1.3 2020/02/02 23:34:34 tom Exp $ +# $Id: split-path.awk,v 1.4 2022/11/26 23:46:20 tom Exp $ BEGIN { cols = 72; } /[$]THIS_DATADIR/ { + if (substr(this_datadir, length(this_datadir)) != "/") + this_datadir = this_datadir "/"; gsub("[$]THIS_DATADIR", "\"" this_datadir "\""); if ( length ($0) > cols ) { indent = index($0, "\"") - 1;